Skip to content

Commit

Permalink
Fixed assertInternalType deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
Linus Juhlin authored and pierredup committed Apr 10, 2021
1 parent 74a8a5e commit 5314756
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 30 deletions.
6 changes: 3 additions & 3 deletions Tests/Bridge/Spl/ArrayObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function shouldAllowCastToArrayFromCustomArrayObject()

$array = (array) $arrayObject;

$this->assertInternalType('array', $array);
$this->assertIsArray($array);
$this->assertEquals(array('foo' => 'barbaz'), $array);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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']);
Expand Down
18 changes: 9 additions & 9 deletions Tests/CoreGatewayFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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']);
Expand All @@ -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']);
Expand All @@ -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']);
Expand All @@ -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']);
Expand All @@ -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']);
Expand All @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions Tests/Extension/ExtensionCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down
2 changes: 1 addition & 1 deletion Tests/GatewayFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function shouldAllowCreateGatewayConfig()

$config = $factory->createConfig();

$this->assertInternalType('array', $config);
$this->assertIsArray($config);
$this->assertNotEmpty($config);
}
}
6 changes: 3 additions & 3 deletions Tests/GatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
Expand All @@ -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]);
Expand Down Expand Up @@ -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]);
Expand Down
14 changes: 7 additions & 7 deletions Tests/PayumBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,18 +81,18 @@ 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());
$this->assertArrayHasKey(Payout::class, $payum->getStorages());


$factories = $payum->getGatewayFactories();
$this->assertInternalType('array', $factories);
$this->assertIsArray($factories);
$this->assertGreaterThan(40, $factories);

$this->assertArrayHasKey('paypal_express_checkout', $factories);
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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;
Expand All @@ -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']);
Expand Down Expand Up @@ -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']);

Expand Down
4 changes: 2 additions & 2 deletions Tests/Registry/AbstractRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Tests/Request/GetBinaryStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function shouldCallIsXXXStatus($isXXXMethod)
{
$getStatus = new GetBinaryStatus(new \stdClass());

$this->assertInternalType('boolean', $getStatus->$isXXXMethod());
$this->assertIsBool($getStatus->$isXXXMethod());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/Request/GetHumanStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function shouldCallIsXXXStatus($isXXXMethod)
{
$getStatus = new GetHumanStatus(new \stdClass());

$this->assertInternalType('boolean', $getStatus->$isXXXMethod());
$this->assertIsBool($getStatus->$isXXXMethod());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/Security/Util/RandomTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function shouldAllowGenerateToken()
{
$token = Random::generateToken();

$this->assertInternalType('string', $token);
$this->assertIsString($token);
$this->assertEquals(43, strlen($token));
}
}

0 comments on commit 5314756

Please sign in to comment.