diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php index 5a05637a1c2..2872b1a87d5 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityDisplayTest.php @@ -41,7 +41,7 @@ class MigrateBlockContentEntityDisplayTest extends MigrateDrupal7TestBase { */ protected function assertDisplay($id, $component_id) { $component = EntityViewDisplay::load($id)->getComponent($component_id); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('hidden', $component['label']); } diff --git a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php index 645f70bc97d..fb2492cf907 100644 --- a/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php +++ b/core/modules/block_content/tests/src/Kernel/Migrate/MigrateBlockContentEntityFormDisplayTest.php @@ -41,7 +41,7 @@ class MigrateBlockContentEntityFormDisplayTest extends MigrateDrupal7TestBase { */ protected function assertDisplay($id, $component_id) { $component = EntityFormDisplay::load($id)->getComponent($component_id); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('text_textarea_with_summary', $component['type']); } diff --git a/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php index 3b18c67e79e..d5e7d75f675 100644 --- a/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php +++ b/core/modules/ckeditor/tests/src/Unit/Plugin/CKEditorPlugin/LanguageTest.php @@ -52,7 +52,7 @@ class LanguageTest extends UnitTestCase { $config = $this->plugin->getConfig($editor); - $this->assertInternalType('array', $config); + $this->assertIsArray($config); $this->assertTrue(in_array('ar:Arabic:rtl', $config['language_list'])); $this->assertTrue(in_array('zh-hans:Chinese, Simplified', $config['language_list'])); $this->assertTrue(in_array('en:English', $config['language_list'])); diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php index 2c13371fb8a..94f1e9fe86e 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityDisplayTest.php @@ -44,7 +44,7 @@ class MigrateCommentEntityDisplayTest extends MigrateDrupal6TestBase { */ protected function assertDisplay($id, $component_id) { $component = EntityViewDisplay::load($id)->getComponent($component_id); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('hidden', $component['label']); $this->assertSame('comment_default', $component['type']); $this->assertSame(20, $component['weight']); diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php index 74a871521ac..4999a569756 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplaySubjectTest.php @@ -38,7 +38,7 @@ class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal6TestBase */ protected function assertSubjectVisible($id) { $component = EntityFormDisplay::load($id)->getComponent('subject'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('string_textfield', $component['type']); $this->assertSame(10, $component['weight']); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php index c9e0d6b8a6f..15b57de3010 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d6/MigrateCommentEntityFormDisplayTest.php @@ -43,7 +43,7 @@ class MigrateCommentEntityFormDisplayTest extends MigrateDrupal6TestBase { */ protected function assertDisplay($id, $component_id) { $component = EntityFormDisplay::load($id)->getComponent($component_id); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('comment_default', $component['type']); $this->assertSame(20, $component['weight']); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php index d43b14c4150..59a62c992cf 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityDisplayTest.php @@ -42,7 +42,7 @@ class MigrateCommentEntityDisplayTest extends MigrateDrupal7TestBase { */ protected function assertDisplay($id, $component_id) { $component = EntityViewDisplay::load($id)->getComponent($component_id); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('hidden', $component['label']); $this->assertSame('comment_default', $component['type']); $this->assertSame(20, $component['weight']); diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php index 9c7dbddbf8e..3ab1196da2d 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php @@ -35,7 +35,7 @@ class MigrateCommentEntityFormDisplaySubjectTest extends MigrateDrupal7TestBase */ protected function assertSubjectVisible($id) { $component = EntityFormDisplay::load($id)->getComponent('subject'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('string_textfield', $component['type']); $this->assertSame(10, $component['weight']); } diff --git a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php index 75647b16731..1425cda2e7a 100644 --- a/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php +++ b/core/modules/comment/tests/src/Kernel/Migrate/d7/MigrateCommentEntityFormDisplayTest.php @@ -42,7 +42,7 @@ class MigrateCommentEntityFormDisplayTest extends MigrateDrupal7TestBase { */ protected function assertDisplay($id, $component_id) { $component = EntityFormDisplay::load($id)->getComponent($component_id); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('comment_default', $component['type']); $this->assertSame(20, $component['weight']); } diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php index c3f207160c1..b30d3c7dd9a 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldFormatterSettingsTest.php @@ -206,7 +206,7 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase { // reference field. $display = EntityViewDisplay::load('node.employee.default'); $component = $display->getComponent('field_company'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('entity_reference_label', $component['type']); // The default node reference formatter shows the referenced node's title // as a link. @@ -214,14 +214,14 @@ class MigrateFieldFormatterSettingsTest extends MigrateDrupal6TestBase { $display = EntityViewDisplay::load('node.employee.teaser'); $component = $display->getComponent('field_company'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('entity_reference_label', $component['type']); // The plain node reference formatter shows the referenced node's title, // unlinked. $this->assertFalse($component['settings']['link']); $component = $display->getComponent('field_commander'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('entity_reference_label', $component['type']); // The default user reference formatter links to the referenced user. $this->assertTrue($component['settings']['link']); diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php index 284f69dd0d3..a58fd344746 100644 --- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php +++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldWidgetSettingsTest.php @@ -107,22 +107,22 @@ class MigrateFieldWidgetSettingsTest extends MigrateDrupal6TestBase { $component = $display_repository->getFormDisplay('node', 'employee', 'default') ->getComponent('field_company'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('options_select', $component['type']); $component = $display_repository->getFormDisplay('node', 'employee', 'default') ->getComponent('field_company_2'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('options_buttons', $component['type']); $component = $display_repository->getFormDisplay('node', 'employee', 'default') ->getComponent('field_company_3'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('entity_reference_autocomplete_tags', $component['type']); $component = $display_repository->getFormDisplay('node', 'employee', 'default') ->getComponent('field_commander'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $this->assertSame('options_select', $component['type']); } diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php index 4199f933414..bda611c6a22 100644 --- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldInstanceSettingsTest.php @@ -29,7 +29,7 @@ class FieldInstanceSettingsTest extends MigrateTestCase { ->getMock(); $value = $plugin->transform([[], ['type' => 'image_image'], ['data' => '']], $executable, $row, 'foo'); - $this->assertInternalType('array', $value['default_image']); + $this->assertIsArray($value['default_image']); $this->assertSame('', $value['default_image']['alt']); $this->assertSame('', $value['default_image']['title']); $this->assertNull($value['default_image']['width']); diff --git a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php index ceaefec3669..cb12d960d0a 100644 --- a/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php +++ b/core/modules/field/tests/src/Unit/Plugin/migrate/process/d7/FieldSettingsTest.php @@ -36,7 +36,7 @@ class FieldSettingsTest extends MigrateTestCase { ]); $value = $plugin->transform([], $executable, $row, 'foo'); - $this->assertInternalType('array', $value); + $this->assertIsArray($value); $this->assertSame('', $value['default_image']['uuid']); } diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php index 42372713662..3698781ecbd 100644 --- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php +++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php @@ -101,7 +101,7 @@ class MediaSourceOEmbedVideoTest extends MediaSourceTestBase { $display = \Drupal::service('entity_display.repository')->getViewDisplay('media', $media_type_id); $this->assertFalse($display->isNew()); $component = $display->getComponent('field_media_oembed_video'); - $this->assertInternalType('array', $component); + $this->assertIsArray($component); $component['settings']['max_width'] = 240; $display->setComponent('field_media_oembed_video', $component); $this->assertSame(SAVED_UPDATED, $display->save()); diff --git a/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php b/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php index 3b71cdc92fa..3dc099be20d 100644 --- a/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php +++ b/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php @@ -43,7 +43,7 @@ class OEmbedIframeControllerTest extends MediaKernelTestBase { ->get('controller_resolver') ->getControllerFromDefinition('\Drupal\media\Controller\OEmbedIframeController::render'); - $this->assertInternalType('callable', $controller); + $this->assertIsCallable($controller); $this->expectException('\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException'); $this->expectExceptionMessage('This resource is not available'); diff --git a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php index 7ebc2bb1b1a..2ca50fb5a96 100644 --- a/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php +++ b/core/modules/media_library/tests/src/Functional/MediaLibraryDisplayModeTest.php @@ -239,7 +239,7 @@ class MediaLibraryDisplayModeTest extends BrowserTestBase { $this->assertSame(['thumbnail'], array_keys($view_display->getComponents())); // Assert the thumbnail image style. $thumbnail = $view_display->getComponent('thumbnail'); - $this->assertInternalType('array', $thumbnail); + $this->assertIsArray($thumbnail); $this->assertSame($image_style, $thumbnail['settings']['image_style']); } diff --git a/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php b/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php index 38d92f90b47..c9f7f790608 100644 --- a/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php +++ b/core/modules/migrate/tests/src/Kernel/process/FileCopyTest.php @@ -90,7 +90,7 @@ class FileCopyTest extends FileTestBase { clearstatcache(TRUE, $destination_path); $timestamp = (new \SplFileInfo($file_reuse))->getMTime(); - $this->assertInternalType('int', $timestamp); + $this->assertIsInt($timestamp); // We need to make sure the modified timestamp on the file is sooner than // the attempted migration. diff --git a/core/modules/system/tests/src/Kernel/Timezone/TimezoneTest.php b/core/modules/system/tests/src/Kernel/Timezone/TimezoneTest.php index 24ce60ba3f0..e9efa6d057d 100644 --- a/core/modules/system/tests/src/Kernel/Timezone/TimezoneTest.php +++ b/core/modules/system/tests/src/Kernel/Timezone/TimezoneTest.php @@ -19,7 +19,7 @@ class TimezoneTest extends KernelTestBase { public function testSystemTimeZones() { // Test the default parameters for system_time_zones(). $result = system_time_zones(); - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertArrayHasKey('Africa/Dar_es_Salaam', $result); $this->assertEquals('Africa/Dar es Salaam', $result['Africa/Dar_es_Salaam']); @@ -27,7 +27,7 @@ class TimezoneTest extends KernelTestBase { $result = system_time_zones(NULL, TRUE); // Check a two-level time zone. - $this->assertInternalType('array', $result); + $this->assertIsArray($result); $this->assertArrayHasKey('Africa', $result); $this->assertArrayHasKey('Africa/Dar_es_Salaam', $result['Africa']); $this->assertEquals('Dar es Salaam', $result['Africa']['Africa/Dar_es_Salaam']); diff --git a/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php b/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php index 5f07966475f..0826a2c1064 100644 --- a/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/views/field/EntityOperationsUnitTest.php @@ -87,7 +87,7 @@ class EntityOperationsUnitTest extends UnitTestCase { */ public function testDefineOptions() { $options = $this->plugin->defineOptions(); - $this->assertInternalType('array', $options); + $this->assertIsArray($options); $this->assertArrayHasKey('destination', $options); } diff --git a/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php b/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php index 03645581245..adbd125fe4f 100644 --- a/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php +++ b/core/modules/views/tests/src/Unit/Routing/ViewPageControllerTest.php @@ -64,7 +64,7 @@ class ViewPageControllerTest extends UnitTestCase { $route_match = RouteMatch::createFromRequest($request); $output = $this->pageController->handle($route_match->getParameter('view_id'), $route_match->getParameter('display_id'), $route_match); - $this->assertInternalType('array', $output); + $this->assertIsArray($output); $this->assertEquals($build, $output); } diff --git a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php index 0b86802c98a..a8ab676bed2 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php @@ -66,9 +66,9 @@ class EntityReferenceAutocompleteWidgetTest extends WebDriverTestBase { ]); // To satisfy config schema, the size setting must be an integer, not just // a numeric value. See https://www.drupal.org/node/2885441. - $this->assertInternalType('integer', $form_display->getComponent($field_name)['settings']['size']); + $this->assertIsInt($form_display->getComponent($field_name)['settings']['size']); $form_display->save(); - $this->assertInternalType('integer', $form_display->getComponent($field_name)['settings']['size']); + $this->assertIsInt($form_display->getComponent($field_name)['settings']['size']); // Visit the node add page. $this->drupalGet('node/add/page'); diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php b/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php index 8db77528620..f047f6471c9 100644 --- a/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php +++ b/core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php @@ -51,7 +51,7 @@ class ContextAwarePluginBaseTest extends KernelTestBase { * @covers ::getContextDefinitions */ public function testGetContextDefinitions() { - $this->assertInternalType('array', $this->plugin->getContextDefinitions()); + $this->assertIsArray($this->plugin->getContextDefinitions()); } /** diff --git a/core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php b/core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php index 058669b590a..13ed8bb8faa 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php @@ -53,7 +53,7 @@ class ThemeRenderAndAutoescapeTest extends KernelTestBase { $renderer = \Drupal::service('renderer'); $output = $renderer->executeInRenderContext($context, $theme_render_and_autoescape); $this->assertEquals($expected, $output); - $this->assertInternalType('string', $output); + $this->assertIsString($output); } /** diff --git a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php index b950a39e98a..826b4f397c0 100644 --- a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php +++ b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php @@ -83,7 +83,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase { public function testGet() { $this->setupDefaultExpectations(); - $this->assertInternalType('string', $this->generator->get()); + $this->assertIsString($this->generator->get()); $this->assertNotSame($this->generator->get(), $this->generator->get($this->randomMachineName())); $this->assertNotSame($this->generator->get($this->randomMachineName()), $this->generator->get($this->randomMachineName())); } @@ -107,7 +107,7 @@ class CsrfTokenGeneratorTest extends UnitTestCase { ->method('setCsrfTokenSeed') ->with($this->isType('string')); - $this->assertInternalType('string', $this->generator->get()); + $this->assertIsString($this->generator->get()); } /** diff --git a/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php b/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php index c812485b52d..4e273b29109 100644 --- a/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php @@ -23,9 +23,9 @@ class BatchBuilderTest extends UnitTestCase { public function testDefaultValues() { $batch = (new BatchBuilder())->toArray(); - $this->assertInternalType('array', $batch); + $this->assertIsArray($batch); $this->assertArrayHasKey('operations', $batch); - $this->assertInternalType('array', $batch['operations']); + $this->assertIsArray($batch['operations']); $this->assertEmpty($batch['operations'], 'Operations array is empty.'); $this->assertEquals(new TranslatableMarkup('Processing'), $batch['title']); $this->assertEquals(new TranslatableMarkup('Initializing.'), $batch['init_message']); @@ -34,10 +34,10 @@ class BatchBuilderTest extends UnitTestCase { $this->assertNull($batch['finished']); $this->assertNull($batch['file']); $this->assertArrayHasKey('library', $batch); - $this->assertInternalType('array', $batch['library']); + $this->assertIsArray($batch['library']); $this->assertEmpty($batch['library']); $this->assertArrayHasKey('url_options', $batch); - $this->assertInternalType('array', $batch['url_options']); + $this->assertIsArray($batch['url_options']); $this->assertEmpty($batch['url_options']); $this->assertArrayHasKey('progressive', $batch); $this->assertTrue($batch['progressive']); diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index 38997e7f76a..c0c67884c1d 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -564,7 +564,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase { ->method('getPropertiesToExport') ->willReturn(['id' => 'configId', 'dependencies' => 'dependencies']); $properties = $this->entity->toArray(); - $this->assertInternalType('array', $properties); + $this->assertIsArray($properties); $this->assertEquals(['configId' => $this->entity->id(), 'dependencies' => []], $properties); } @@ -590,7 +590,7 @@ class ConfigEntityBaseUnitTest extends UnitTestCase { ->with('id') ->willReturn('id'); $properties = $entity->toArray(); - $this->assertInternalType('array', $properties); + $this->assertIsArray($properties); $this->assertEquals(['configId' => $entity->id(), 'dependencies' => []], $properties); } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php index 10d9e97d80a..6f23e80921b 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php @@ -139,15 +139,15 @@ class EntityListBuilderTest extends UnitTestCase { $list->setRedirectDestination($this->redirectDestination); $operations = $list->getOperations($this->role); - $this->assertInternalType('array', $operations); + $this->assertIsArray($operations); $this->assertArrayHasKey('edit', $operations); - $this->assertInternalType('array', $operations['edit']); + $this->assertIsArray($operations['edit']); $this->assertArrayHasKey('title', $operations['edit']); $this->assertArrayHasKey('delete', $operations); - $this->assertInternalType('array', $operations['delete']); + $this->assertIsArray($operations['delete']); $this->assertArrayHasKey('title', $operations['delete']); $this->assertArrayHasKey($operation_name, $operations); - $this->assertInternalType('array', $operations[$operation_name]); + $this->assertIsArray($operations[$operation_name]); $this->assertArrayHasKey('title', $operations[$operation_name]); } diff --git a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php index deed1e0bc9b..b5113687b81 100644 --- a/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/TypedData/EntityAdapterUnitTest.php @@ -220,7 +220,7 @@ class EntityAdapterUnitTest extends UnitTestCase { * @covers ::getConstraints */ public function testGetConstraints() { - $this->assertInternalType('array', $this->entityAdapter->getConstraints()); + $this->assertIsArray($this->entityAdapter->getConstraints()); } /** diff --git a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php index 5b6400ab718..f8914856c28 100644 --- a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php +++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php @@ -53,7 +53,7 @@ class LockBackendAbstractTest extends UnitTestCase { */ public function testGetLockId() { $lock_id = $this->lock->getLockId(); - $this->assertInternalType('string', $lock_id); + $this->assertIsString($lock_id); // Example lock ID would be '7213141505232b6ee2cb967.27683891'. $this->assertRegExp('/[\da-f]+\.\d+/', $lock_id); // Test the same lock ID is returned a second time. diff --git a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php index 10955fc82e0..a94a82d097b 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php @@ -333,7 +333,7 @@ class DefaultPluginManagerTest extends UnitTestCase { $this->expectedDefinitions['banana']['provider'] = 'plugin_test'; $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler, NULL); - $this->assertInternalType('array', $plugin_manager->getDefinitions()); + $this->assertIsArray($plugin_manager->getDefinitions()); } /** @@ -343,9 +343,9 @@ class DefaultPluginManagerTest extends UnitTestCase { $module_handler = $this->prophesize(ModuleHandlerInterface::class); $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL); $cache_contexts = $plugin_manager->getCacheContexts(); - $this->assertInternalType('array', $cache_contexts); + $this->assertIsArray($cache_contexts); array_map(function ($cache_context) { - $this->assertInternalType('string', $cache_context); + $this->assertIsString($cache_context); }, $cache_contexts); } @@ -356,9 +356,9 @@ class DefaultPluginManagerTest extends UnitTestCase { $module_handler = $this->prophesize(ModuleHandlerInterface::class); $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL); $cache_tags = $plugin_manager->getCacheTags(); - $this->assertInternalType('array', $cache_tags); + $this->assertIsArray($cache_tags); array_map(function ($cache_tag) { - $this->assertInternalType('string', $cache_tag); + $this->assertIsString($cache_tag); }, $cache_tags); } @@ -369,7 +369,7 @@ class DefaultPluginManagerTest extends UnitTestCase { $module_handler = $this->prophesize(ModuleHandlerInterface::class); $plugin_manager = new TestPluginManager($this->namespaces, $this->expectedDefinitions, $module_handler->reveal(), NULL); $cache_max_age = $plugin_manager->getCacheMaxAge(); - $this->assertInternalType('int', $cache_max_age); + $this->assertIsInt($cache_max_age); } /** diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php index 01f837c0ff1..3aec9164510 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDirectoryDiscoveryTest.php @@ -51,7 +51,7 @@ class YamlDirectoryDiscoveryTest extends UnitTestCase { $definitions = $discovery->getDefinitions(); - $this->assertInternalType('array', $definitions); + $this->assertIsArray($definitions); $this->assertCount(4, $definitions); foreach ($definitions as $id => $definition) { diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php index 0880169af33..41a26997527 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryDecoratorTest.php @@ -70,7 +70,7 @@ class YamlDiscoveryDecoratorTest extends UnitTestCase { public function testGetDefinitions() { $definitions = $this->discoveryDecorator->getDefinitions(); - $this->assertInternalType('array', $definitions); + $this->assertIsArray($definitions); $this->assertCount(6, $definitions); foreach ($this->expectedKeys as $expected_key) { diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php index 04e686ae8ba..c5289440c33 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/YamlDiscoveryTest.php @@ -51,7 +51,7 @@ class YamlDiscoveryTest extends UnitTestCase { public function testGetDefinitions() { $definitions = $this->discovery->getDefinitions(); - $this->assertInternalType('array', $definitions); + $this->assertIsArray($definitions); $this->assertCount(4, $definitions); foreach ($this->expectedKeys as $expected_key) { diff --git a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php index 3331d44076e..ef95a1624c6 100644 --- a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php +++ b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php @@ -62,7 +62,7 @@ class PrivateKeyTest extends UnitTestCase { * Tests PrivateKey::get() with no private key from state. */ public function testGetNoState() { - $this->assertInternalType('string', $this->privateKey->get()); + $this->assertIsString($this->privateKey->get()); } /** diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php index 1e81b0bfff9..6a0c9618636 100644 --- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php +++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php @@ -236,7 +236,7 @@ class UnroutedUrlTest extends UnitTestCase { */ public function testGetOptions($uri) { $url = Url::fromUri($uri); - $this->assertInternalType('array', $url->getOptions()); + $this->assertIsArray($url->getOptions()); } } diff --git a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php index ed2262e0c6b..00e674ee56b 100644 --- a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php @@ -271,7 +271,7 @@ class TokenTest extends UnitTestCase { }); $result = $this->token->replace($string, ['tokens' => $tokens]); - $this->assertInternalType('string', $result); + $this->assertIsString($result); $this->assertEquals($expected, $result); } diff --git a/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php b/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php index 6dd7c461a5b..c6ca4e8ade1 100644 --- a/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php +++ b/core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php @@ -26,7 +26,6 @@ trait PHPUnit8Warnings { 'Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead.', 'Using assertNotContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringNotContainsString() or assertStringNotContainsStringIgnoringCase() instead.', 'assertArraySubset() is deprecated and will be removed in PHPUnit 9.', - '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.', 'readAttribute() is deprecated and will be removed in PHPUnit 9.', 'getObjectAttribute() is deprecated and will be removed in PHPUnit 9.', 'assertAttributeEquals() is deprecated and will be removed in PHPUnit 9.',