From d79154b3612ec5c79c2fd81adf3ee40b53f83c69 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 13 Dec 2020 20:34:09 +0100 Subject: Initial commit --- tests/Test.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 tests/Test.php (limited to 'tests') diff --git a/tests/Test.php b/tests/Test.php new file mode 100644 index 0000000..fd99ace --- /dev/null +++ b/tests/Test.php @@ -0,0 +1,42 @@ +push(new OAuthMiddleware(), 'oauth'); + + // Initialize the client with the handler option and cardmarket oauth data + $this->client = new Client([ + 'handler' => $stack, + 'http_errors' => false, + 'base_uri' => 'https://sandbox.cardmarket.com/ws/v2.0/output.json/', + 'cardmarket' => [ + 'app_token' => $_ENV['CARDMARKET_APP_TOKEN'], + 'app_secret' => $_ENV['CARDMARKET_APP_SECRET'], + 'access_token' => $_ENV['CARDMARKET_ACCESS_TOKEN'], + 'access_token_secret' => $_ENV['CARDMARKET_ACCESS_TOKEN_SECRET'], + ], + ]); + } + + public function testOAuthSuccess() + { + $response = $this->client->get('account'); + + $this->assertEquals(200, $response->getStatusCode()); + } +} -- cgit v1.2.3