From 37565e43b56454b52ca52a9f6d5b1166104d191d Mon Sep 17 00:00:00 2001 From: Hendrik Obermayer Date: Thu, 4 May 2017 12:57:20 +0200 Subject: [PATCH] changed version number --- LICENSE.txt | 2 +- src/Client.php | 4 ++-- tests/ClientTest.php | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 69b7a24..62f0cd8 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Cash Payment Solutions GmbH +Copyright (c) 2016-2017 Cash Payment Solutions GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/Client.php b/src/Client.php index 9d7ae1c..10fdc9d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -26,7 +26,7 @@ class Client /** * @var string */ - private $userAgent = 'PHP SDK v2.0.2'; + private $userAgent = 'PHP SDK v2.0.3'; /** @@ -79,7 +79,7 @@ public function handle($request) curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2); $response = curl_exec($curl); - + $error = curl_error($curl); if ($error || false === $response) { throw new Exception\CurlException('Error during cURL: ' . $error . ' [' . curl_errno($curl) . ']'); diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 96a4d42..25a9b98 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -13,6 +13,10 @@ class ClientTest extends \PHPUnit_Framework_TestCase */ private $client; + /** + * @var string + */ + private $userAgent = 'PHP SDK v2.0.3'; public function setUp() { @@ -21,7 +25,7 @@ public function setUp() public function testDefaultUserAgent() { - $this->assertAttributeEquals('PHP SDK v2.0.2', 'userAgent', $this->client); + $this->assertAttributeEquals($this->userAgent, 'userAgent', $this->client); } public function testSetUserAgent() @@ -41,7 +45,7 @@ public function testBuildHeaderWithIdempotency() $header = $this->client->buildHeader($request); $this->assertEquals('Host: api.barzahlen.de', $header[0]); $this->assertContains('Date: ', $header[1]); - $this->assertEquals('User-Agent: PHP SDK v2.0.2', $header[2]); + $this->assertEquals('User-Agent: '.$this->userAgent, $header[2]); $this->assertRegExp('/^Authorization: BZ1-HMAC-SHA256 DivisionId=12345, Signature=[a-f0-9]{64}$/', $header[3]); $this->assertRegExp('/^Idempotency-Key: [a-f0-9]{32}$/', $header[4]); } @@ -54,7 +58,7 @@ public function testBuildHeaderWithoutIdempotencyForSandbox() $header = $client->buildHeader($request); $this->assertEquals('Host: api-sandbox.barzahlen.de', $header[0]); $this->assertContains('Date: ', $header[1]); - $this->assertEquals('User-Agent: PHP SDK v2.0.2', $header[2]); + $this->assertEquals('User-Agent: '.$this->userAgent, $header[2]); $this->assertRegExp('/^Authorization: BZ1-HMAC-SHA256 DivisionId=12345, Signature=[a-f0-9]{64}$/', $header[3]); $this->assertArrayNotHasKey(4, $header); }