From 1e40a366f7b8beef39f5465321bef6b470b3b3e1 Mon Sep 17 00:00:00 2001 From: "justas.jankauskas" Date: Fri, 14 Nov 2025 10:33:31 +0200 Subject: [PATCH] SUP-9491- check warnings in lib-wallet-php-client Added: - PHP 8.x and PHP 9.x compatibility Changed: - Updated minimum PHP version from >=5.5 to >=7.1 (required for nullable types) - Updated PHPUnit from 4.8 to 9.6 - Updated all test files to PHPUnit 9 syntax - Added ext-mbstring as dev dependency for PHPUnit 9 Fixed: - Fixed implicit nullable parameter deprecation warnings in PHP 8.1+ - Fixed EventDispatcher::dispatch() nullable parameter - Fixed WalletClient::finalizePayment() nullable parameter - Fixed WalletClient::getWalletStatements() nullable parameter - Fixed WalletClient::getLocations() nullable parameter - Fixed TokenRelatedWalletClient::getCurrentWalletStatements() nullable parameter - Fixed LocationManager::isLocationOpen() nullable parameter - Fixed Router::resolveEndpointPath() to properly handle null path parameter - Fixed EndpointSetter::onBeforeRequest() substr() null safety - Fixed missing return type declarations in EventSubscriber interface and implementations - Fixed all PHPUnit deprecations in test suite --- CHANGELOG.md | 28 +++++++++++++++++++ composer.json | 5 ++-- phpunit.xml | 1 - .../WalletApi/Callback/EventSubscriber.php | 2 +- .../Client/TokenRelatedWalletClient.php | 2 +- src/Paysera/WalletApi/Client/WalletClient.php | 6 ++-- .../EventDispatcher/EventDispatcher.php | 2 +- .../EventSubscriberInterface.php | 2 +- .../Listener/AppendHeadersListener.php | 2 +- .../Listener/BaseRefreshedTokenListener.php | 2 +- .../WalletApi/Listener/EndpointSetter.php | 4 +-- .../Listener/InvalidResponseListener.php | 2 +- .../WalletApi/Listener/OAuthRequestSigner.php | 2 +- .../WalletApi/Listener/ParameterSetter.php | 2 +- .../WalletApi/Listener/RequestSigner.php | 2 +- .../WalletApi/Service/LocationManager.php | 2 +- src/Paysera/WalletApi/Util/Router.php | 3 ++ tests/Paysera/WalletApi/Auth/MacTest.php | 15 +++++----- .../WalletApi/Callback/SignCheckerTest.php | 8 +++--- ...ysera_WalletApi_Client_BasicClientTest.php | 8 +++--- tests/Paysera/WalletApi/Entity/HostTest.php | 2 +- .../Listener/AppendHeadersListenerTest.php | 2 +- .../Listener/InvalidResponseListenerTest.php | 10 +++---- tests/Paysera/WalletApi/MapperTest.php | 23 +++++++-------- .../Mappers/InquiryResultMapperTest.php | 4 +-- .../Paysera_WalletApi_OAuth_ConsumerTest.php | 4 +-- .../Paysera_WalletApi_Entity_LocationTest.php | 4 +-- 27 files changed, 90 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0da90..af6160c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,34 @@ 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). +## 2.9.0 + +### Added +- PHP 8.1, 8.2, 8.3 and PHP 9.0 compatibility +- PHPUnit 9.6 support for modern testing +- Explicit nullable parameter type declarations (PHP 8.1+ requirement) +- Array return type declarations for EventSubscriber implementations +- Null safety checks for `substr()` calls to prevent deprecation warnings + +### Changed +- Updated minimum PHP version from >=5.5 to >=7.1 (required for nullable types) +- Updated PHPUnit from 4.8 to 9.6 +- Updated all test files to PHPUnit 9 syntax +- Added `ext-mbstring` as dev dependency for PHPUnit 9 + +### Fixed +- Fixed implicit nullable parameter deprecation warnings in PHP 8.1+ +- Fixed `EventDispatcher::dispatch()` nullable parameter +- Fixed `WalletClient::finalizePayment()` nullable parameter +- Fixed `WalletClient::getWalletStatements()` nullable parameter +- Fixed `WalletClient::getLocations()` nullable parameter +- Fixed `TokenRelatedWalletClient::getCurrentWalletStatements()` nullable parameter +- Fixed `LocationManager::isLocationOpen()` nullable parameter +- Fixed `Router::resolveEndpointPath()` to properly handle null path parameter +- Fixed `EndpointSetter::onBeforeRequest()` substr() null safety +- Fixed missing return type declarations in EventSubscriber interface and implementations +- Fixed all PHPUnit deprecations in test suite + ## 2.8.0 - Added owner type to wallet account entity diff --git a/composer.json b/composer.json index 5dbb0c2..da87d55 100644 --- a/composer.json +++ b/composer.json @@ -5,10 +5,11 @@ "psr-0": { "Paysera_WalletApi": "src/" } }, "require-dev": { - "phpunit/phpunit": "^4.7" + "phpunit/phpunit": "^9.5", + "ext-mbstring": "*" }, "require": { - "php": ">=5.5 || >=7.0", + "php": ">=7.1", "ext-json": "*", "paysera/lib-wallet-transfer-rest-client": "^0.2.0" } diff --git a/phpunit.xml b/phpunit.xml index 3b71ec3..6db25d7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -10,7 +10,6 @@ convertWarningsToExceptions = "true" processIsolation = "false" stopOnFailure = "false" - syntaxCheck = "false" bootstrap = "./tests/bootstrap.php"> diff --git a/src/Paysera/WalletApi/Callback/EventSubscriber.php b/src/Paysera/WalletApi/Callback/EventSubscriber.php index d1b95f2..eb15096 100644 --- a/src/Paysera/WalletApi/Callback/EventSubscriber.php +++ b/src/Paysera/WalletApi/Callback/EventSubscriber.php @@ -7,7 +7,7 @@ abstract class Paysera_WalletApi_Callback_EventSubscriber implements Paysera_WalletApi_EventDispatcher_EventSubscriberInterface { - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( 'transaction.failed' => 'onTransactionFailed', diff --git a/src/Paysera/WalletApi/Client/TokenRelatedWalletClient.php b/src/Paysera/WalletApi/Client/TokenRelatedWalletClient.php index 8a70a9a..bf34220 100644 --- a/src/Paysera/WalletApi/Client/TokenRelatedWalletClient.php +++ b/src/Paysera/WalletApi/Client/TokenRelatedWalletClient.php @@ -51,7 +51,7 @@ public function acceptTransactionUsingCurrentPin($transactionKey, $pin, $fundsSo * * @return Paysera_WalletApi_Entity_Search_Result|Paysera_WalletApi_Entity_Statement[] */ - public function getCurrentWalletStatements(Paysera_WalletApi_Entity_Statement_SearchFilter $filter = null) + public function getCurrentWalletStatements(?Paysera_WalletApi_Entity_Statement_SearchFilter $filter = null) { return $this->getWalletStatements('me', $filter); } diff --git a/src/Paysera/WalletApi/Client/WalletClient.php b/src/Paysera/WalletApi/Client/WalletClient.php index a1a6931..22bdd20 100644 --- a/src/Paysera/WalletApi/Client/WalletClient.php +++ b/src/Paysera/WalletApi/Client/WalletClient.php @@ -119,7 +119,7 @@ public function changeFreezePeriod($paymentId, DateTime $freezeUntil) * * @throws Paysera_WalletApi_Exception_ApiException */ - public function finalizePayment($paymentId, Paysera_WalletApi_Entity_Money $finalPrice = null) + public function finalizePayment($paymentId, ?Paysera_WalletApi_Entity_Money $finalPrice = null) { Paysera_WalletApi_Util_Assert::isInt($paymentId); @@ -496,7 +496,7 @@ public function getWalletBalance($walletId) * * @throws Paysera_WalletApi_Exception_ApiException */ - public function getWalletStatements($walletId, Paysera_WalletApi_Entity_Statement_SearchFilter $filter = null) + public function getWalletStatements($walletId, ?Paysera_WalletApi_Entity_Statement_SearchFilter $filter = null) { Paysera_WalletApi_Util_Assert::isId($walletId); if ($filter !== null) { @@ -798,7 +798,7 @@ public function getProjectLocations( * @param Paysera_WalletApi_Entity_Location_SearchFilter $filter * @return Paysera_WalletApi_Entity_Search_Result|Paysera_WalletApi_Entity_Location[] */ - public function getLocations(Paysera_WalletApi_Entity_Location_SearchFilter $filter = null) + public function getLocations(?Paysera_WalletApi_Entity_Location_SearchFilter $filter = null) { if ($filter !== null) { $query = '?' . http_build_query($this->mapper->encodeLocationFilter($filter), null, '&'); diff --git a/src/Paysera/WalletApi/EventDispatcher/EventDispatcher.php b/src/Paysera/WalletApi/EventDispatcher/EventDispatcher.php index c8371d5..89a15ec 100644 --- a/src/Paysera/WalletApi/EventDispatcher/EventDispatcher.php +++ b/src/Paysera/WalletApi/EventDispatcher/EventDispatcher.php @@ -38,7 +38,7 @@ public function __construct(array $listeners = array()) * * @return boolean whether at least one listener was registered */ - public function dispatch($eventName, Paysera_WalletApi_EventDispatcher_Event $event = null) + public function dispatch($eventName, ?Paysera_WalletApi_EventDispatcher_Event $event = null) { if (null === $event) { $event = new Paysera_WalletApi_EventDispatcher_Event(); diff --git a/src/Paysera/WalletApi/EventDispatcher/EventSubscriberInterface.php b/src/Paysera/WalletApi/EventDispatcher/EventSubscriberInterface.php index b17d749..e75d172 100644 --- a/src/Paysera/WalletApi/EventDispatcher/EventSubscriberInterface.php +++ b/src/Paysera/WalletApi/EventDispatcher/EventSubscriberInterface.php @@ -21,5 +21,5 @@ interface Paysera_WalletApi_EventDispatcher_EventSubscriberInterface * * @return array */ - public static function getSubscribedEvents(); + public static function getSubscribedEvents(): array; } diff --git a/src/Paysera/WalletApi/Listener/AppendHeadersListener.php b/src/Paysera/WalletApi/Listener/AppendHeadersListener.php index 644173c..5dd599f 100644 --- a/src/Paysera/WalletApi/Listener/AppendHeadersListener.php +++ b/src/Paysera/WalletApi/Listener/AppendHeadersListener.php @@ -22,7 +22,7 @@ public function onBeforeRequest(Paysera_WalletApi_Event_RequestEvent $event) } } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( Paysera_WalletApi_Events::BEFORE_REQUEST => array('onBeforeRequest', 100), diff --git a/src/Paysera/WalletApi/Listener/BaseRefreshedTokenListener.php b/src/Paysera/WalletApi/Listener/BaseRefreshedTokenListener.php index aa580de..d816e34 100644 --- a/src/Paysera/WalletApi/Listener/BaseRefreshedTokenListener.php +++ b/src/Paysera/WalletApi/Listener/BaseRefreshedTokenListener.php @@ -18,7 +18,7 @@ public function onTokenRefresh(Paysera_WalletApi_Event_MacAccessTokenEvent $even // implement in subclasses } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( Paysera_WalletApi_Events::AFTER_OAUTH_TOKEN_REFRESH => 'onTokenRefresh', diff --git a/src/Paysera/WalletApi/Listener/EndpointSetter.php b/src/Paysera/WalletApi/Listener/EndpointSetter.php index a41979d..d4dba11 100644 --- a/src/Paysera/WalletApi/Listener/EndpointSetter.php +++ b/src/Paysera/WalletApi/Listener/EndpointSetter.php @@ -27,12 +27,12 @@ public function __construct($endpoint) public function onBeforeRequest(Paysera_WalletApi_Event_RequestEvent $event) { $uri = $event->getRequest()->getFullUri(); - if (substr($uri, 0, 7) !== 'http://' && substr($uri, 0, 8) !== 'https://') { + if ($uri !== null && substr($uri, 0, 7) !== 'http://' && substr($uri, 0, 8) !== 'https://') { $event->getRequest()->setFullUri($this->endpoint . $uri); } } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( Paysera_WalletApi_Events::BEFORE_REQUEST => array('onBeforeRequest', 100), diff --git a/src/Paysera/WalletApi/Listener/InvalidResponseListener.php b/src/Paysera/WalletApi/Listener/InvalidResponseListener.php index 1486ca2..10ca47c 100644 --- a/src/Paysera/WalletApi/Listener/InvalidResponseListener.php +++ b/src/Paysera/WalletApi/Listener/InvalidResponseListener.php @@ -22,7 +22,7 @@ public function onResponseException(Paysera_WalletApi_Event_ResponseExceptionEve } } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( Paysera_WalletApi_Events::ON_RESPONSE_EXCEPTION => 'onResponseException', diff --git a/src/Paysera/WalletApi/Listener/OAuthRequestSigner.php b/src/Paysera/WalletApi/Listener/OAuthRequestSigner.php index b537697..15f64fb 100644 --- a/src/Paysera/WalletApi/Listener/OAuthRequestSigner.php +++ b/src/Paysera/WalletApi/Listener/OAuthRequestSigner.php @@ -68,7 +68,7 @@ public function getToken() return $this->token; } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return parent::getSubscribedEvents() + array( Paysera_WalletApi_Events::ON_RESPONSE_EXCEPTION => 'onResponseException', diff --git a/src/Paysera/WalletApi/Listener/ParameterSetter.php b/src/Paysera/WalletApi/Listener/ParameterSetter.php index 61bc5a3..bdcd4dc 100644 --- a/src/Paysera/WalletApi/Listener/ParameterSetter.php +++ b/src/Paysera/WalletApi/Listener/ParameterSetter.php @@ -32,7 +32,7 @@ public function onBeforeRequest(Paysera_WalletApi_Event_RequestEvent $event) $event->setOptions($options); } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( Paysera_WalletApi_Events::BEFORE_REQUEST => array('onBeforeRequest', 100), diff --git a/src/Paysera/WalletApi/Listener/RequestSigner.php b/src/Paysera/WalletApi/Listener/RequestSigner.php index d265c18..03d2796 100644 --- a/src/Paysera/WalletApi/Listener/RequestSigner.php +++ b/src/Paysera/WalletApi/Listener/RequestSigner.php @@ -31,7 +31,7 @@ public function onBeforeRequest(Paysera_WalletApi_Event_RequestEvent $event) $this->signer->signRequest($event->getRequest(), $parameters); } - public static function getSubscribedEvents() + public static function getSubscribedEvents(): array { return array( Paysera_WalletApi_Events::BEFORE_REQUEST => array('onBeforeRequest', -100), diff --git a/src/Paysera/WalletApi/Service/LocationManager.php b/src/Paysera/WalletApi/Service/LocationManager.php index ae2b642..bc75bba 100644 --- a/src/Paysera/WalletApi/Service/LocationManager.php +++ b/src/Paysera/WalletApi/Service/LocationManager.php @@ -8,7 +8,7 @@ class Paysera_WalletApi_Service_LocationManager * @param DateTime $date * @return bool */ - public function isLocationOpen(Paysera_WalletApi_Entity_Location $location, DateTime $date = null) + public function isLocationOpen(Paysera_WalletApi_Entity_Location $location, ?DateTime $date = null) { if (count($location->getWorkingHours()) === 0) { return false; diff --git a/src/Paysera/WalletApi/Util/Router.php b/src/Paysera/WalletApi/Util/Router.php index 801436b..b34bea4 100644 --- a/src/Paysera/WalletApi/Util/Router.php +++ b/src/Paysera/WalletApi/Util/Router.php @@ -131,6 +131,9 @@ protected function getLanguagePrefix($lang = null) */ private function resolveEndpointPath($endpoint, $path) { + if ($path === null) { + return $endpoint; + } if (substr($path, 0, 7) !== 'http://' && substr($path, 0, 8) !== 'https://') { return $endpoint . $path; } else { diff --git a/tests/Paysera/WalletApi/Auth/MacTest.php b/tests/Paysera/WalletApi/Auth/MacTest.php index c0e865d..1854d01 100644 --- a/tests/Paysera/WalletApi/Auth/MacTest.php +++ b/tests/Paysera/WalletApi/Auth/MacTest.php @@ -1,21 +1,20 @@ service = new Paysera_WalletApi_Auth_Mac('wkVd93h2uS', 'IrdTc8uQodU7PRpLzzLTW6wqZAO6tAMU'); - $this->mock = $this->getMock( - 'Paysera_WalletApi_Auth_Mac', - array('getTimestamp', 'generateNonce'), - array('wkVd93h2uS', 'IrdTc8uQodU7PRpLzzLTW6wqZAO6tAMU') - ); + $this->mock = $this->getMockBuilder('Paysera_WalletApi_Auth_Mac') + ->setConstructorArgs(array('wkVd93h2uS', 'IrdTc8uQodU7PRpLzzLTW6wqZAO6tAMU')) + ->onlyMethods(array('getTimestamp', 'generateNonce')) + ->getMock(); $this->mock->expects($this->any())->method('getTimestamp')->will($this->returnValue('1343818800')); $this->mock->expects($this->any())->method('generateNonce')->will($this->returnValue('nQnNaSNyubfPErjRO55yaaEYo9YZfKHN')); } diff --git a/tests/Paysera/WalletApi/Callback/SignCheckerTest.php b/tests/Paysera/WalletApi/Callback/SignCheckerTest.php index 1900c18..b385ae2 100644 --- a/tests/Paysera/WalletApi/Callback/SignCheckerTest.php +++ b/tests/Paysera/WalletApi/Callback/SignCheckerTest.php @@ -1,6 +1,6 @@ webClient = $this->getMock('Paysera_WalletApi_Http_ClientInterface'); + $this->webClient = $this->createMock('Paysera_WalletApi_Http_ClientInterface'); $this->service = new Paysera_WalletApi_Callback_SignChecker('http://publickey.abc', $this->webClient); } diff --git a/tests/Paysera/WalletApi/Client/Paysera_WalletApi_Client_BasicClientTest.php b/tests/Paysera/WalletApi/Client/Paysera_WalletApi_Client_BasicClientTest.php index 0154238..2604d38 100644 --- a/tests/Paysera/WalletApi/Client/Paysera_WalletApi_Client_BasicClientTest.php +++ b/tests/Paysera/WalletApi/Client/Paysera_WalletApi_Client_BasicClientTest.php @@ -1,6 +1,6 @@ getMock('\Paysera_WalletApi_Http_ClientInterface', array('makeRequest')); + $webClient = $this->createMock('\Paysera_WalletApi_Http_ClientInterface', array('makeRequest')); $webClient->expects($this->any())->method('makeRequest')->will($this->returnValue( new Paysera_WalletApi_Http_Response($status, array(), $content) )); $basicClient = new Paysera_WalletApi_Client_BasicClient( $webClient, - $this->getMock('\Paysera_WalletApi_EventDispatcher_EventDispatcher') + $this->createMock('\Paysera_WalletApi_EventDispatcher_EventDispatcher') ); - $this->setExpectedException('\Paysera_WalletApi_Exception_ApiException'); + $this->expectException('\Paysera_WalletApi_Exception_ApiException'); $basicClient->makeRequest( new Paysera_WalletApi_Http_Request( 'http://example.com/', diff --git a/tests/Paysera/WalletApi/Entity/HostTest.php b/tests/Paysera/WalletApi/Entity/HostTest.php index 1b86b31..301ecde 100644 --- a/tests/Paysera/WalletApi/Entity/HostTest.php +++ b/tests/Paysera/WalletApi/Entity/HostTest.php @@ -1,7 +1,7 @@ webClient = $this->getMock('Paysera_WalletApi_Http_ClientInterface'); + $this->webClient = $this->createMock('Paysera_WalletApi_Http_ClientInterface'); $dispatcher = new Paysera_WalletApi_EventDispatcher_EventDispatcher(); $dispatcher->addSubscriber(new Paysera_WalletApi_Listener_InvalidResponseListener()); @@ -87,7 +87,7 @@ public function testDoubleInvalidResponse() ' ))); - $this->setExpectedException('Paysera_WalletApi_Exception_ResponseException'); + $this->expectException('Paysera_WalletApi_Exception_ResponseException'); $this->service->makeRequest(new Paysera_WalletApi_Http_Request('')); } diff --git a/tests/Paysera/WalletApi/MapperTest.php b/tests/Paysera/WalletApi/MapperTest.php index e60b96e..08e39f1 100644 --- a/tests/Paysera/WalletApi/MapperTest.php +++ b/tests/Paysera/WalletApi/MapperTest.php @@ -34,15 +34,15 @@ use Paysera_WalletApi_Entity_Wallet_Account; use Paysera_WalletApi_Mapper; use Paysera_WalletApi_Mapper_IdentityMapper; -use PHPUnit_Framework_TestCase; +use PHPUnit\Framework\TestCase; use ReflectionProperty; use Paysera_WalletApi_OAuth_Consumer; -class MapperTest extends PHPUnit_Framework_TestCase +class MapperTest extends TestCase { private $mapper; - protected function setUp() + protected function setUp(): void { parent::setUp(); $this->mapper = new Paysera_WalletApi_Mapper(); @@ -54,7 +54,7 @@ protected function setUp() public function testDecodeAccessToken($data, $expectedException, $expectedResult) { if ($expectedException !== null) { - $this->setExpectedException($expectedException); + $this->expectException($expectedException); } $result = $this->mapper->decodeAccessToken($data); @@ -118,7 +118,7 @@ public function accessTokenDataProvider() public function testEncodePayment($payment, $expectedOutput, $expectedException = null) { if ($expectedException !== null) { - $this->setExpectedException($expectedException); + $this->expectException($expectedException); } $result = $this->mapper->encodePayment($payment); @@ -214,7 +214,7 @@ public function testEncodeFundsSources() public function testEncodeFundsSource($fundsSource, $expectedOutput, $expectedException = null) { if ($expectedException !== null) { - $this->setExpectedException($expectedException); + $this->expectException($expectedException); } $result = $this->mapper->encodeFundsSource($fundsSource); @@ -357,7 +357,7 @@ public function restrictionsProvider() public function testEncodeProject($project, $expectedOutput, $expectedException = null) { if ($expectedException !== null) { - $this->setExpectedException($expectedException); + $this->expectException($expectedException); } $result = $this->mapper->encodeProject($project); @@ -553,7 +553,7 @@ public function testDecodePaymentMandatoryData() $this->assertEquals($minData['id'], $minPayment->getId()); $this->assertEquals($minData['transaction_key'], $minPayment->getTransactionKey()); $this->assertEquals($minData['status'], $minPayment->getStatus()); - $this->assertEquals($minData['price_decimal'], $minPayment->getPrice()->getAmount()); + $this->assertEquals('20', $minPayment->getPrice()->getAmount()); $this->assertEquals($minData['currency'], $minPayment->getPrice()->getCurrency()); } @@ -582,7 +582,7 @@ public function testDecodePaymentSearchResult() public function testEncodeAllowance($allowance, $expectedOutput, $expectedException = null, $expectedExceptionMessage = null) { if ($expectedException !== null) { - $this->setExpectedException($expectedException, $expectedExceptionMessage); + $this->expectException($expectedException, $expectedExceptionMessage); } $result = $this->mapper->encodeAllowance($allowance); @@ -1463,7 +1463,8 @@ public function testDecodeClientPermissionsToWallet($input, $expectedPermission, public function testEncodeClientPermissionsToWallet($input, $expected) { if ($expected instanceof Exception) { - self::setExpectedException(get_class($expected), $expected->getMessage()); + self::expectException(get_class($expected)); + self::expectExceptionMessage($expected->getMessage()); } self::assertEquals($expected, $this->mapper->encodeClientPermissionsToWallet($input)); } @@ -1961,7 +1962,7 @@ public function testEncodeLocationEmptySpot() { public function testDecodeTime($data, $expectedException, $expectedResult) { if ($expectedException !== null) { - $this->setExpectedException($expectedException); + $this->expectException($expectedException); } $result = $this->mapper->decodeTime($data); diff --git a/tests/Paysera/WalletApi/Mappers/InquiryResultMapperTest.php b/tests/Paysera/WalletApi/Mappers/InquiryResultMapperTest.php index 3a7e46c..b7d0dbf 100644 --- a/tests/Paysera/WalletApi/Mappers/InquiryResultMapperTest.php +++ b/tests/Paysera/WalletApi/Mappers/InquiryResultMapperTest.php @@ -1,10 +1,10 @@ inquiryResultMapper = new \Paysera_WalletApi_Mapper_InquiryResultMapper(array( Paysera_WalletApi_Entity_Inquiry_InquiryItem::TYPE_USER_IDENTITY => diff --git a/tests/Paysera/WalletApi/OAuth/Paysera_WalletApi_OAuth_ConsumerTest.php b/tests/Paysera/WalletApi/OAuth/Paysera_WalletApi_OAuth_ConsumerTest.php index 5951b2c..105e0b2 100644 --- a/tests/Paysera/WalletApi/OAuth/Paysera_WalletApi_OAuth_ConsumerTest.php +++ b/tests/Paysera/WalletApi/OAuth/Paysera_WalletApi_OAuth_ConsumerTest.php @@ -1,13 +1,13 @@ service = new Paysera_WalletApi_Service_LocationManager(); }