MDL-67673 phpunit: Remove deprecated assertInternalType()
While this is not strictly required, because removal will happen in PHPUnit 9.0, we are already getting rid of all uses in core. From release notes:https://phpunit.de/announcements/phpunit-8.html assertInternalType() is deprecated and will be removed in PHPUnit 9. Refactor your test to use assertIsArray(), assertIsBool(), assertIsFloat(), assertIsInt(), assertIsNumeric(), assertIsObject(), assertIsResource(), assertIsString(), assertIsScalar(), assertIsCallable(), or assertIsIterable() instead.
This commit is contained in:
Vendored
+15
-15
@@ -122,7 +122,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
$this->assertCount(3, $stores);
|
||||
foreach ($stores as $name => $store) {
|
||||
// Check its an array.
|
||||
$this->assertInternalType('array', $store);
|
||||
$this->assertIsArray($store);
|
||||
// Check the name is the key.
|
||||
$this->assertEquals($name, $store['name']);
|
||||
// Check that it has been declared default.
|
||||
@@ -370,11 +370,11 @@ class core_cache_testcase extends advanced_testcase {
|
||||
'key1' => array(1, 2, 3),
|
||||
'key2' => array(3, 2, 1),
|
||||
));
|
||||
$this->assertInternalType('array', $cache->get('key1'));
|
||||
$this->assertInternalType('array', $cache->get('key2'));
|
||||
$this->assertIsArray($cache->get('key1'));
|
||||
$this->assertIsArray($cache->get('key2'));
|
||||
$this->assertCount(3, $cache->get('key1'));
|
||||
$this->assertCount(3, $cache->get('key2'));
|
||||
$this->assertInternalType('array', $cache->get_many(array('key1', 'key2')));
|
||||
$this->assertIsArray($cache->get_many(array('key1', 'key2')));
|
||||
$this->assertCount(2, $cache->get_many(array('key1', 'key2')));
|
||||
$this->assertEquals(2, $cache->delete_many(array('key1', 'key2')));
|
||||
|
||||
@@ -539,7 +539,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
$this->assertTrue($cache->purge());
|
||||
$this->assertTrue($cache->set('b', 'B'));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -675,7 +675,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
// Test with multiple keys.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -686,7 +686,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
|
||||
// Test with multiple keys including missing ones.
|
||||
$result = $cache->get_many(array('a', 'c', 'e'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
@@ -724,7 +724,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
// Test with multiple keys.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -735,7 +735,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
|
||||
// Test with multiple keys including missing ones.
|
||||
$result = $cache->get_many(array('a', 'c', 'e'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
@@ -773,7 +773,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
// Test with multiple keys.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -784,7 +784,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
|
||||
// Test with multiple keys including missing ones.
|
||||
$result = $cache->get_many(array('a', 'c', 'e'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('c', $result);
|
||||
@@ -1401,7 +1401,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
// Test the many commands.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -1412,7 +1412,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
$this->assertEquals($result, $cache->get_many(array('a', 'b', 'c')));
|
||||
$this->assertEquals(2, $cache->delete_many(array('a', 'c')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -1470,7 +1470,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
// Test the many commands.
|
||||
$this->assertEquals(3, $cache->set_many(array('a' => 'A', 'b' => 'B', 'c' => 'C')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
@@ -1481,7 +1481,7 @@ class core_cache_testcase extends advanced_testcase {
|
||||
$this->assertEquals($result, $cache->get_many(array('a', 'b', 'c')));
|
||||
$this->assertEquals(2, $cache->delete_many(array('a', 'c')));
|
||||
$result = $cache->get_many(array('a', 'b', 'c'));
|
||||
$this->assertInternalType('array', $result);
|
||||
$this->assertIsArray($result);
|
||||
$this->assertCount(3, $result);
|
||||
$this->assertArrayHasKey('a', $result);
|
||||
$this->assertArrayHasKey('b', $result);
|
||||
|
||||
Reference in New Issue
Block a user