From 5314756ae9efb29ed64a68d92a5620c2d00500a4 Mon Sep 17 00:00:00 2001 From: Linus Juhlin Date: Thu, 16 Jan 2020 10:19:43 +0100 Subject: [PATCH] Fixed assertInternalType deprecation --- Tests/Bridge/Spl/ArrayObjectTest.php | 6 +++--- Tests/CoreGatewayFactoryTest.php | 18 +++++++++--------- Tests/Extension/ExtensionCollectionTest.php | 4 ++-- Tests/GatewayFactoryTest.php | 2 +- Tests/GatewayTest.php | 6 +++--- Tests/PayumBuilderTest.php | 14 +++++++------- Tests/Registry/AbstractRegistryTest.php | 4 ++-- Tests/Request/GetBinaryStatusTest.php | 2 +- Tests/Request/GetHumanStatusTest.php | 2 +- Tests/Security/Util/RandomTest.php | 2 +- 10 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Tests/Bridge/Spl/ArrayObjectTest.php b/Tests/Bridge/Spl/ArrayObjectTest.php index 01b9fa1..ff87a83 100644 --- a/Tests/Bridge/Spl/ArrayObjectTest.php +++ b/Tests/Bridge/Spl/ArrayObjectTest.php @@ -125,7 +125,7 @@ public function shouldAllowCastToArrayFromCustomArrayObject() $array = (array) $arrayObject; - $this->assertInternalType('array', $array); + $this->assertIsArray($array); $this->assertEquals(array('foo' => 'barbaz'), $array); } @@ -196,7 +196,7 @@ public function shouldAllowIterateOverCustomArrayObject() $array = iterator_to_array($arrayObject); - $this->assertInternalType('array', $array); + $this->assertIsArray($array); $this->assertEquals(array('foo' => 'barbaz'), $array); } @@ -351,7 +351,7 @@ public function shouldConvertArrayObjectToPrimitiveArrayMakingSensitiveValueUnsa $primitiveArray = $arrayObject->toUnsafeArray(); - $this->assertInternalType('array', $primitiveArray); + $this->assertIsArray($primitiveArray); $this->assertArrayHasKey('creditCard', $primitiveArray); $this->assertEquals('theCreditCard', $primitiveArray['creditCard']); diff --git a/Tests/CoreGatewayFactoryTest.php b/Tests/CoreGatewayFactoryTest.php index 709c30e..79151c0 100644 --- a/Tests/CoreGatewayFactoryTest.php +++ b/Tests/CoreGatewayFactoryTest.php @@ -146,7 +146,7 @@ public function shouldAllowCreateGatewayConfig() $config = $factory->createConfig(); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); $this->assertInstanceOf(\Closure::class, $config['payum.http_client']); @@ -174,10 +174,10 @@ public function shouldConfigurePaths() $config = $factory->createConfig(); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); - $this->assertInternalType('array', $config['payum.paths']); + $this->assertIsArray($config['payum.paths']); $this->assertNotEmpty($config['payum.paths']); $this->assertArrayHasKey('PayumCore', $config['payum.paths']); @@ -196,10 +196,10 @@ public function shouldConfigurePathsPlusExtraOne() 'payum.paths' => ['FooNamespace' => 'FooPath'] ]); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); - $this->assertInternalType('array', $config['payum.paths']); + $this->assertIsArray($config['payum.paths']); $this->assertNotEmpty($config['payum.paths']); $this->assertArrayHasKey('PayumCore', $config['payum.paths']); @@ -219,7 +219,7 @@ public function shouldConfigureTwigEnvironmentGatewayConfig() $config = $factory->createConfig(); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); $this->assertInstanceOf(\Closure::class, $config['twig.env']); @@ -242,7 +242,7 @@ public function shouldConfigureRenderTemplateAction() 'twig.env' => $twig, ]); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); $this->assertSame($twig, $config['twig.env']); @@ -269,7 +269,7 @@ public function shouldConfigureGetTokenActionIfTokenStorageSet() 'payum.security.token_storage' => $tokenStorageMock, ]); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); $this->assertInstanceOf(\Closure::class, $config['payum.action.get_token']); @@ -293,7 +293,7 @@ public function shouldAddDefaultConfigPassedInConstructorWhileCreatingGatewayCon $config = $factory->createConfig(); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertArrayHasKey('foo', $config); $this->assertEquals('fooVal', $config['foo']); diff --git a/Tests/Extension/ExtensionCollectionTest.php b/Tests/Extension/ExtensionCollectionTest.php index 5ebcf8d..6bbb0d5 100644 --- a/Tests/Extension/ExtensionCollectionTest.php +++ b/Tests/Extension/ExtensionCollectionTest.php @@ -41,7 +41,7 @@ public function shouldAllowAddExtensionAppendByDefault() $addedExtensions = $this->readAttribute($collection, 'extensions'); - $this->assertInternalType('array', $addedExtensions); + $this->assertIsArray($addedExtensions); $this->assertCount(2, $addedExtensions); $this->assertSame($extensionFirst, $addedExtensions[0]); @@ -63,7 +63,7 @@ public function shouldAllowAddExtensionWithForcedPrepend() $addedExtensions = $this->readAttribute($collection, 'extensions'); - $this->assertInternalType('array', $addedExtensions); + $this->assertIsArray($addedExtensions); $this->assertCount(2, $addedExtensions); $this->assertSame($extensionSecond, $addedExtensions[0]); diff --git a/Tests/GatewayFactoryTest.php b/Tests/GatewayFactoryTest.php index 254817d..7aa883a 100644 --- a/Tests/GatewayFactoryTest.php +++ b/Tests/GatewayFactoryTest.php @@ -74,7 +74,7 @@ public function shouldAllowCreateGatewayConfig() $config = $factory->createConfig(); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); } } diff --git a/Tests/GatewayTest.php b/Tests/GatewayTest.php index 7db3287..0a6fbf0 100644 --- a/Tests/GatewayTest.php +++ b/Tests/GatewayTest.php @@ -74,7 +74,7 @@ public function shouldAllowAddActionAppendByDefault() $actualActions = $this->readAttribute($gateway, 'actions'); - $this->assertInternalType('array', $actualActions); + $this->assertIsArray($actualActions); $this->assertCount(2, $actualActions); $this->assertSame($expectedFirstAction, $actualActions[0]); $this->assertSame($expectedSecondAction, $actualActions[1]); @@ -95,7 +95,7 @@ public function shouldAllowAddActionWithPrependForced() $actualActions = $this->readAttribute($gateway, 'actions'); - $this->assertInternalType('array', $actualActions); + $this->assertIsArray($actualActions); $this->assertCount(2, $actualActions); $this->assertSame($expectedFirstAction, $actualActions[0]); $this->assertSame($expectedSecondAction, $actualActions[1]); @@ -129,7 +129,7 @@ public function shouldAllowAddApiWithPrependForced() $actualApis = $this->readAttribute($gateway, 'apis'); - $this->assertInternalType('array', $actualApis); + $this->assertIsArray($actualApis); $this->assertCount(2, $actualApis); $this->assertSame($expectedFirstApi, $actualApis[0]); $this->assertSame($expectedSecondApi, $actualApis[1]); diff --git a/Tests/PayumBuilderTest.php b/Tests/PayumBuilderTest.php index ac1f25f..a8c4145 100644 --- a/Tests/PayumBuilderTest.php +++ b/Tests/PayumBuilderTest.php @@ -81,10 +81,10 @@ public function shouldBuildDefaultPayum() $this->assertInstanceOf(HttpRequestVerifier::class, $payum->getHttpRequestVerifier()); $this->assertInstanceOf(GenericTokenFactory::class, $payum->getTokenFactory()); - $this->assertInternalType('array', $payum->getGateways()); + $this->assertIsArray($payum->getGateways()); $this->assertCount(0, $payum->getGateways()); - $this->assertInternalType('array', $payum->getStorages()); + $this->assertIsArray($payum->getStorages()); $this->assertCount(3, $payum->getStorages()); $this->assertArrayHasKey(Payment::class, $payum->getStorages()); $this->assertArrayHasKey(ArrayObject::class, $payum->getStorages()); @@ -92,7 +92,7 @@ public function shouldBuildDefaultPayum() $factories = $payum->getGatewayFactories(); - $this->assertInternalType('array', $factories); + $this->assertIsArray($factories); $this->assertGreaterThan(40, $factories); $this->assertArrayHasKey('paypal_express_checkout', $factories); @@ -222,7 +222,7 @@ public function shouldUseGenericTokenFactoryBuilder() ->setGenericTokenFactory(function ($tokenFactory, $paths) use ($expectedTokenFactory) { $this->assertInstanceOf(TokenFactoryInterface::class, $tokenFactory); - $this->assertInternalType('array', $paths); + $this->assertIsArray($paths); $this->assertEquals([ 'capture' => 'capture.php', 'notify' => 'notify.php', @@ -551,7 +551,7 @@ public function shouldUseCoreGatewayFactoryBuilder() $payum = (new PayumBuilder()) ->addDefaultStorages() ->setCoreGatewayFactory(function ($config) use ($expectedCoreGatewayFactory) { - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertNotEmpty($config); return $expectedCoreGatewayFactory; @@ -578,7 +578,7 @@ public function shouldAddStorageExtensionForTheAddedStorage() ->addDefaultStorages() ->addStorage(TestModel::class, $expectedStorage) ->setCoreGatewayFactory(function ($config) use ($expectedStorage) { - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertArrayHasKey('payum.extension.storage_payum_core_tests_testmodel', $config, var_export($config, true)); $this->assertInstanceOf(StorageExtension::class, $config['payum.extension.storage_payum_core_tests_testmodel']); $this->assertAttributeSame($expectedStorage, 'storage', $config['payum.extension.storage_payum_core_tests_testmodel']); @@ -731,7 +731,7 @@ public function shouldAddTokenStorageToCoreGatewayConfig() ->addDefaultStorages() ->setTokenStorage($tokenStorageMock) ->setCoreGatewayFactory(function ($config) use ($tokenStorageMock) { - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertArrayHasKey('payum.security.token_storage', $config); $this->assertSame($tokenStorageMock, $config['payum.security.token_storage']); diff --git a/Tests/Registry/AbstractRegistryTest.php b/Tests/Registry/AbstractRegistryTest.php index 9b84506..c37de88 100644 --- a/Tests/Registry/AbstractRegistryTest.php +++ b/Tests/Registry/AbstractRegistryTest.php @@ -127,7 +127,7 @@ public function shouldAllowGetAllGateways() $gateways = $registry->getGateways(); - $this->assertInternalType('array', $gateways); + $this->assertIsArray($gateways); $this->assertCount(2, $gateways); $this->assertArrayHasKey('fooName', $gateways); @@ -184,7 +184,7 @@ public function shouldAllowGetAllGatewayFactories() $gateways = $registry->getGatewayFactories(); - $this->assertInternalType('array', $gateways); + $this->assertIsArray($gateways); $this->assertCount(2, $gateways); $this->assertArrayHasKey('foo', $gateways); diff --git a/Tests/Request/GetBinaryStatusTest.php b/Tests/Request/GetBinaryStatusTest.php index 2802512..916ff75 100644 --- a/Tests/Request/GetBinaryStatusTest.php +++ b/Tests/Request/GetBinaryStatusTest.php @@ -80,7 +80,7 @@ public function shouldCallIsXXXStatus($isXXXMethod) { $getStatus = new GetBinaryStatus(new \stdClass()); - $this->assertInternalType('boolean', $getStatus->$isXXXMethod()); + $this->assertIsBool($getStatus->$isXXXMethod()); } /** diff --git a/Tests/Request/GetHumanStatusTest.php b/Tests/Request/GetHumanStatusTest.php index a2fe8f2..e8faea5 100644 --- a/Tests/Request/GetHumanStatusTest.php +++ b/Tests/Request/GetHumanStatusTest.php @@ -80,7 +80,7 @@ public function shouldCallIsXXXStatus($isXXXMethod) { $getStatus = new GetHumanStatus(new \stdClass()); - $this->assertInternalType('boolean', $getStatus->$isXXXMethod()); + $this->assertIsBool($getStatus->$isXXXMethod()); } /** diff --git a/Tests/Security/Util/RandomTest.php b/Tests/Security/Util/RandomTest.php index 19afe69..d7ffb26 100644 --- a/Tests/Security/Util/RandomTest.php +++ b/Tests/Security/Util/RandomTest.php @@ -13,7 +13,7 @@ public function shouldAllowGenerateToken() { $token = Random::generateToken(); - $this->assertInternalType('string', $token); + $this->assertIsString($token); $this->assertEquals(43, strlen($token)); } }