From 221b7aed0638c51138a848422f64d1804470a858 Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Sat, 11 Apr 2020 06:35:50 +0100
Subject: [PATCH] Issue #3108006 by mondrake, ravi.shankar, longwave: Replace
 assertInternalType() calls with dedicated methods

---
 .../Migrate/MigrateBlockContentEntityDisplayTest.php |  2 +-
 .../MigrateBlockContentEntityFormDisplayTest.php     |  2 +-
 .../src/Unit/Plugin/CKEditorPlugin/LanguageTest.php  |  2 +-
 .../Migrate/d6/MigrateCommentEntityDisplayTest.php   |  2 +-
 .../MigrateCommentEntityFormDisplaySubjectTest.php   |  2 +-
 .../d6/MigrateCommentEntityFormDisplayTest.php       |  2 +-
 .../Migrate/d7/MigrateCommentEntityDisplayTest.php   |  2 +-
 .../MigrateCommentEntityFormDisplaySubjectTest.php   |  2 +-
 .../d7/MigrateCommentEntityFormDisplayTest.php       |  2 +-
 .../Migrate/d6/MigrateFieldFormatterSettingsTest.php |  6 +++---
 .../Migrate/d6/MigrateFieldWidgetSettingsTest.php    |  8 ++++----
 .../migrate/process/d7/FieldInstanceSettingsTest.php |  2 +-
 .../Plugin/migrate/process/d7/FieldSettingsTest.php  |  2 +-
 .../MediaSourceOEmbedVideoTest.php                   |  2 +-
 .../tests/src/Kernel/OEmbedIframeControllerTest.php  |  2 +-
 .../src/Functional/MediaLibraryDisplayModeTest.php   |  2 +-
 .../tests/src/Kernel/process/FileCopyTest.php        |  2 +-
 .../tests/src/Kernel/Timezone/TimezoneTest.php       |  4 ++--
 .../Plugin/views/field/EntityOperationsUnitTest.php  |  2 +-
 .../src/Unit/Routing/ViewPageControllerTest.php      |  2 +-
 .../EntityReferenceAutocompleteWidgetTest.php        |  4 ++--
 .../Plugin/Context/ContextAwarePluginBaseTest.php    |  2 +-
 .../Core/Theme/ThemeRenderAndAutoescapeTest.php      |  2 +-
 .../Tests/Core/Access/CsrfTokenGeneratorTest.php     |  4 ++--
 .../Drupal/Tests/Core/Batch/BatchBuilderTest.php     |  8 ++++----
 .../Core/Config/Entity/ConfigEntityBaseUnitTest.php  |  4 ++--
 .../Tests/Core/Entity/EntityListBuilderTest.php      |  8 ++++----
 .../Core/Entity/TypedData/EntityAdapterUnitTest.php  |  2 +-
 .../Tests/Core/Lock/LockBackendAbstractTest.php      |  2 +-
 .../Tests/Core/Plugin/DefaultPluginManagerTest.php   | 12 ++++++------
 .../Plugin/Discovery/YamlDirectoryDiscoveryTest.php  |  2 +-
 .../Plugin/Discovery/YamlDiscoveryDecoratorTest.php  |  2 +-
 .../Core/Plugin/Discovery/YamlDiscoveryTest.php      |  2 +-
 core/tests/Drupal/Tests/Core/PrivateKeyTest.php      |  2 +-
 core/tests/Drupal/Tests/Core/UnroutedUrlTest.php     |  2 +-
 core/tests/Drupal/Tests/Core/Utility/TokenTest.php   |  2 +-
 core/tests/Drupal/Tests/Traits/PHPUnit8Warnings.php  |  1 -
 37 files changed, 56 insertions(+), 57 deletions(-)

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 5a05637a1c2b..2872b1a87d5b 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 @@ protected function setUp() {
    */
   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 645f70bc97d3..fb2492cf9072 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 @@ protected function setUp() {
    */
   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 3b18c67e79e0..d5e7d75f6750 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 @@ public function testGetConfig($language_list, $expected_number) {
 
     $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 2c13371fb8a5..94f1e9fe86eb 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 @@ protected function setUp() {
    */
   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 74a871521acb..4999a5697567 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 @@ protected function setUp() {
    */
   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 c9e0d6b8a6f3..15b57de30103 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 @@ protected function setUp() {
    */
   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 d43b14c41506..59a62c992cfa 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 @@ protected function setUp() {
    */
   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 9c7dbddbf8e4..3ab1196da2d3 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 @@ protected function setUp() {
    */
   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 75647b167312..1425cda2e7ad 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 @@ protected function setUp() {
    */
   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 c3f207160c16..b30d3c7dd9a1 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 @@ public function testEntityDisplaySettings() {
     // 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 @@ public function testEntityDisplaySettings() {
 
     $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 284f69dd0d30..a58fd344746c 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 @@ public function testWidgetSettings() {
 
     $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 4199f9334140..bda611c6a221 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 @@ public function testTransformImageSettings() {
       ->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 ceaefec36695..cb12d960d0a4 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 @@ public function testTransformImageSettings() {
       ]);
 
     $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 423727136629..3698781ecbd4 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
@@ -101,7 +101,7 @@ public function testMediaOEmbedVideoSource() {
     $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 3b71cdc92fa9..3dc099be20d7 100644
--- a/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php
+++ b/core/modules/media/tests/src/Kernel/OEmbedIframeControllerTest.php
@@ -43,7 +43,7 @@ public function testBadHashParameter($hash) {
       ->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 7ebc2bb1b1a7..2ca50fb5a964 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 @@ protected function assertViewDisplay($type_id, $image_style) {
     $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 38d92f90b478..c9f7f790608d 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 @@ public function testSuccessfulReuse($source_path, $destination_path) {
     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 24ce60ba3f09..e9efa6d057da 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 @@ public function testSystemTimeZones() {
     $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 5f07966475f5..0826a2c1064d 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 @@ public function testUsesGroupBy() {
    */
   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 036455812456..adbd125fe4fd 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 @@ public function testPageController() {
     $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 0b86802c98a3..a8ab676bed26 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/EntityReference/EntityReferenceAutocompleteWidgetTest.php
@@ -66,9 +66,9 @@ public function testEntityReferenceAutocompleteWidget() {
     ]);
     // 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 8db77528620a..f047f6471c99 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 @@ public function setUp() {
    * @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 058669b590a9..13ed8bb8faa4 100644
--- a/core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Theme/ThemeRenderAndAutoescapeTest.php
@@ -53,7 +53,7 @@ public function testThemeRenderAndAutoescape($arg, $expected) {
     $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 b950a39e98ad..826b4f397c09 100644
--- a/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Access/CsrfTokenGeneratorTest.php
@@ -83,7 +83,7 @@ protected function setupDefaultExpectations() {
   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 @@ public function testGenerateSeedOnGet() {
       ->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 c812485b52d1..4e273b291092 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 @@ public function testDefaultValues() {
     $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 38997e7f76ae..c0c67884c1dc 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 @@ public function testToArray() {
       ->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 @@ public function testToArrayIdKey() {
       ->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 10d9e97d80ad..6f23e80921b9 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityListBuilderTest.php
@@ -139,15 +139,15 @@ public function testGetOperations() {
     $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 deed1e0bc9be..b5113687b813 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 @@ protected function setUp() {
    * @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 5b6400ab7189..f8914856c289 100644
--- a/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
+++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
@@ -53,7 +53,7 @@ public function testWaitTrue() {
    */
   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 10955fc82e08..a94a82d097bd 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/DefaultPluginManagerTest.php
@@ -333,7 +333,7 @@ public function testGetDefinitionsWithoutRequiredInterface() {
     $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 @@ public function testGetCacheContexts() {
     $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 @@ public function testGetCacheTags() {
     $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 @@ public function testGetCacheMaxAge() {
     $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 01f837c0ff13..3aec91645105 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 @@ public function testGetDefinitions() {
 
     $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 0880169af337..41a26997527a 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 @@ protected function setUp() {
   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 04e686ae8ba8..c5289440c33e 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 @@ protected function setUp() {
   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 3331d44076ee..ef95a1624c6a 100644
--- a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
+++ b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
@@ -62,7 +62,7 @@ public function testGet() {
    * 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 1e81b0bfff9e..6a0c9618636f 100644
--- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
+++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php
@@ -236,7 +236,7 @@ public function testGetUri($uri) {
    */
   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 ed2262e0c6b1..00e674ee56bb 100644
--- a/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
+++ b/core/tests/Drupal/Tests/Core/Utility/TokenTest.php
@@ -271,7 +271,7 @@ public function testReplaceEscaping($string, array $tokens, $expected) {
       });
 
     $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 6dd7c461a5b8..c6ca4e8ade1e 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.',
-- 
GitLab