diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6797a1..6798f765 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,13 +3,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [1.1.1.0][1.1.1.0] +## [1.1.1.1] + +### Fix +* Change debug logging of failed tests that depend on another one to work as expected. +* Several minor changes. + +## [1.1.1.0] ### Changed * Add email property to payment type `card` to meet 3Ds2.x regulations. * Several minor changes. -## [1.1.0.0][1.1.0.0] +## [1.1.0.0] ### Changed * Rebranding of the SDK. @@ -43,3 +49,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [1.1.0.0]: https://github.com/unzerdev/php-sdk/compare/1260b8314af1ac461e33f0cfb382ffcd0e87c105..1.1.0.0 [1.1.1.0]: https://github.com/unzerdev/php-sdk/compare/1.1.0.0..1.1.1.0 +[1.1.1.1]: https://github.com/unzerdev/php-sdk/compare/1.1.1.0..1.1.1.1 diff --git a/examples/InstallmentSecured/PlaceOrderController.php b/examples/InstallmentSecured/PlaceOrderController.php index 615f7a23..998f359a 100644 --- a/examples/InstallmentSecured/PlaceOrderController.php +++ b/examples/InstallmentSecured/PlaceOrderController.php @@ -72,7 +72,7 @@ function redirect($url, $merchantMessage = '', $clientMessage = '') } // Check the result message of the transaction to find out what went wrong. - $merchantMessage = $authorize->getMessage()->getCustomer(); + $merchantMessage = $charge->getMessage()->getCustomer(); } catch (UnzerApiException $e) { $merchantMessage = $e->getMerchantMessage(); $clientMessage = $e->getClientMessage(); diff --git a/phpunit.xml b/phpunit.xml index d0d58a86..58ad4061 100755 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,6 @@ unzer->getDebugHandler(); + $debugHandler = self::getDebugHandler(); if ($this->getStatus() === BaseTestRunner::STATUS_PASSED) { $debugHandler->clearTempLog(); diff --git a/test/BasePaymentTest.php b/test/BasePaymentTest.php index 91a28b90..69407b6a 100755 --- a/test/BasePaymentTest.php +++ b/test/BasePaymentTest.php @@ -52,6 +52,19 @@ class BasePaymentTest extends TestCase /** @var Unzer $unzer */ protected $unzer; + protected static $debughandler; + + /** + * @return TestDebugHandler + */ + public static function getDebugHandler(): TestDebugHandler + { + if (!self::$debughandler instanceof TestDebugHandler) { + self::$debughandler = new TestDebugHandler(); + } + return self::$debughandler; + } + /** * Creates and returns an Unzer object if it does not exist yet. * Uses an invalid but well formed default key if no key is given. @@ -66,7 +79,7 @@ protected function getUnzerObject($privateKey = 's-priv-1234'): Unzer { if (!$this->unzer instanceof Unzer) { $this->unzer = (new Unzer($privateKey)) - ->setDebugHandler(new TestDebugHandler()) + ->setDebugHandler(self::getDebugHandler()) ->setDebugMode(true); } return $this->unzer;