From 44fd22dd4e332d6fd1f7ea4cc88df1647a55cf53 Mon Sep 17 00:00:00 2001 From: Kostandin Dimitrijevic Date: Mon, 25 May 2020 12:37:39 +0200 Subject: [PATCH] Fix unit tests and release 2.0.11 --- CHANGELOG.md | 8 +++++++- .../Registration/RegistrationLegalPolicyDtoTest.php | 7 ++++++- .../Registration/RegistrationRequestDtoTest.php | 7 ++++++- tests/Infrastructure/Http/CurlHttpClientTest.php | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b4e11d..c0e88c17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,13 @@ 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/). -## [2.0.10](https://github.com/packlink-dev/ecommerce_module_core/compare/v2.0.9...v2.0.10) +## Unreleased + +## [2.0.11](https://github.com/packlink-dev/ecommerce_module_core/compare/v2.0.10...v2.0.11) - 2020-05-25 +### Changed +- Fixed unit tests + +## [2.0.10](https://github.com/packlink-dev/ecommerce_module_core/compare/v2.0.9...v2.0.10) - 2020-05-20 ### Added - Added configuration flag for async request progress callback usage (methods `Configuration::isAsyncRequestWithProgress` and `Configuration::setAsyncRequestWithProgress`) diff --git a/tests/BusinessLogic/Registration/RegistrationLegalPolicyDtoTest.php b/tests/BusinessLogic/Registration/RegistrationLegalPolicyDtoTest.php index 286593e7..79b209f4 100644 --- a/tests/BusinessLogic/Registration/RegistrationLegalPolicyDtoTest.php +++ b/tests/BusinessLogic/Registration/RegistrationLegalPolicyDtoTest.php @@ -51,7 +51,12 @@ public function testInvalidRegistrationLegalPolicy() $errors = $e->getValidationErrors(); self::assertCount(2, $errors); - $errorCodes = array_map(create_function('$error', 'return $error->field;'), $errors); + $errorCodes = array_map( + function ($error) { + return $error->field; + }, + $errors + ); self::assertArraySubset(array('data_processing', 'terms_and_conditions'), $errorCodes); } diff --git a/tests/BusinessLogic/Registration/RegistrationRequestDtoTest.php b/tests/BusinessLogic/Registration/RegistrationRequestDtoTest.php index dc595746..2f17f4ce 100644 --- a/tests/BusinessLogic/Registration/RegistrationRequestDtoTest.php +++ b/tests/BusinessLogic/Registration/RegistrationRequestDtoTest.php @@ -124,7 +124,12 @@ private function checkIfValidationExceptionIsThrown($request, $field) $errors = $e->getValidationErrors(); self::assertCount(1, $errors); - $errorCodes = array_map(create_function('$error', 'return $error->field;'), $errors); + $errorCodes = array_map( + function ($error) { + return $error->field; + }, + $errors + ); self::assertArraySubset(array($field), $errorCodes); } diff --git a/tests/Infrastructure/Http/CurlHttpClientTest.php b/tests/Infrastructure/Http/CurlHttpClientTest.php index 6626281a..074cd352 100644 --- a/tests/Infrastructure/Http/CurlHttpClientTest.php +++ b/tests/Infrastructure/Http/CurlHttpClientTest.php @@ -253,7 +253,7 @@ private function assertProgressCallback($isOn = true) 'Curl progress callback should be set for async call.' ); $this->assertFalse( - $curlOptions[CURLOPT_NOPROGRESS], + (bool)$curlOptions[CURLOPT_NOPROGRESS], 'Curl progress callback should be set for async call.' ); $this->assertTrue(