diff --git a/core/modules/contact/tests/src/Unit/MailHandlerTest.php b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
index 09e67a3caf5c3ce2e0111df20aa7f25092305056..439e5077bfe18427e1b3bd157346aa72e7d7fe05 100644
--- a/core/modules/contact/tests/src/Unit/MailHandlerTest.php
+++ b/core/modules/contact/tests/src/Unit/MailHandlerTest.php
@@ -144,7 +144,7 @@ function ($module, $key, $to, $langcode, $params, $from) use (&$results) {
           $this->assertEquals($key, $result['key']);
           $this->assertEquals($to, $result['to']);
           $this->assertEquals($langcode, $result['langcode']);
-          $this->assertArrayEquals($params, $result['params']);
+          $this->assertEquals($params, $result['params']);
           $this->assertEquals($from, $result['from']);
         });
     $this->userStorage->expects($this->any())
diff --git a/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php b/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
index 38e1b98c4e1ce8c9fad77379c32205ddacbb87af..54307f3a0cc36908d906ea2eb6cf6abef752af24 100644
--- a/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
+++ b/core/modules/migrate/tests/src/Unit/Exception/RequirementsExceptionTest.php
@@ -18,7 +18,7 @@ class RequirementsExceptionTest extends UnitTestCase {
    */
   public function testGetRequirements() {
     $exception = new RequirementsException('Missing requirements ', ['requirements' => $this->missingRequirements]);
-    $this->assertArrayEquals(['requirements' => $this->missingRequirements], $exception->getRequirements());
+    $this->assertEquals(['requirements' => $this->missingRequirements], $exception->getRequirements());
   }
 
   /**
diff --git a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
index 4cb14415bb254692d02e6cae39c6105575f908f0..6425ff5392672c8fa04c0571aa8a585cd8cb7755 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
@@ -200,7 +200,7 @@ protected function retrievalAssertHelper($expected_value, $actual_value, $messag
       if (empty($expected_value && $actual_value)) {
         return;
       }
-      $this->assertArrayEquals($expected_value, $actual_value, $message);
+      $this->assertEquals($expected_value, $actual_value, $message);
     }
     else {
       $this->assertSame((string) $expected_value, (string) $actual_value, $message);
diff --git a/core/modules/migrate/tests/src/Unit/MigrationTest.php b/core/modules/migrate/tests/src/Unit/MigrationTest.php
index 8aa87c73249d6e4464d1faf266c230d8d3cf705d..b4fb8a96de35388f9aa4d957254037db23859be2 100644
--- a/core/modules/migrate/tests/src/Unit/MigrationTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrationTest.php
@@ -123,7 +123,7 @@ public function testGetMigrations() {
 
     $requirements = ['test_a', 'test_b', 'test_c', 'test_d'];
     $migration->setRequirements($requirements);
-    $this->assertArrayEquals($requirements, $migration->getRequirements());
+    $this->assertEquals($requirements, $migration->getRequirements());
   }
 
   /**
diff --git a/core/modules/migrate/tests/src/Unit/RowTest.php b/core/modules/migrate/tests/src/Unit/RowTest.php
index 308550c85123196731cd743936cbba6b6733f847..cc16e8a215d0032bb850df867bdf1881f6bd5edd 100644
--- a/core/modules/migrate/tests/src/Unit/RowTest.php
+++ b/core/modules/migrate/tests/src/Unit/RowTest.php
@@ -366,7 +366,7 @@ public function getDataProvider() {
    */
   public function testGetMultiple(array $keys, array $expected_values) {
     $row = $this->createRowWithDestinationProperties($this->testGetSourceProperties, $this->testGetSourceIds, $this->testGetDestinationProperties);
-    $this->assertArrayEquals(array_combine($keys, $expected_values), $row->getMultiple($keys));
+    $this->assertEquals(array_combine($keys, $expected_values), $row->getMultiple($keys));
   }
 
   /**
diff --git a/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php b/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php
index c7edcbecfb2352b770fc3c86bbcc1fa1c8a0a5ef..7501c4e430c34cd744da774ca9e037ffceed583b 100644
--- a/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php
+++ b/core/modules/migrate/tests/src/Unit/process/SubProcessTest.php
@@ -166,7 +166,7 @@ public function testNotFoundSubProcess($process_configuration, $source_values =
     // values ended up in the proper destinations, and that the value of the
     // key (@id) is the same as the destination ID (42).
     $new_value = $plugin->transform($current_value, $migrate_executable, $row, 'test');
-    $this->assertArrayEquals([], $new_value);
+    $this->assertSame([], $new_value);
   }
 
   /**
diff --git a/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php b/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php
index f60225e5eae2e88b17851c14381af1d7f99795ff..bf9a989c5fbc2a9e15e6975f7123298c97aa0a00 100644
--- a/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php
+++ b/core/modules/rest/tests/src/Unit/Entity/RestResourceConfigTest.php
@@ -36,7 +36,7 @@ public function testNormalizeRestMethod() {
       'configuration' => $configuration,
     ], 'rest_resource_config');
 
-    $this->assertArrayEquals($expected, $entity->getMethods());
+    $this->assertEquals($expected, $entity->getMethods());
   }
 
 }
diff --git a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
index be84c8da16efa98d525fbb60765675657c53a1b9..ae2f4a919c378e2d87edb0fc050d608ff73f35fd 100644
--- a/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/area/ViewTest.php
@@ -59,10 +59,10 @@ public function testCalculateDependencies() {
     $this->viewHandler->view->storage = $view_this;
 
     $this->viewHandler->options['view_to_insert'] = 'other:default';
-    $this->assertArrayEquals(['config' => ['view.other']], $this->viewHandler->calculateDependencies());
+    $this->assertEquals(['config' => ['view.other']], $this->viewHandler->calculateDependencies());
 
     $this->viewHandler->options['view_to_insert'] = 'this:default';
-    $this->assertArrayEquals([], $this->viewHandler->calculateDependencies());
+    $this->assertSame([], $this->viewHandler->calculateDependencies());
   }
 
 }
diff --git a/core/modules/workflows/tests/src/Unit/WorkflowTest.php b/core/modules/workflows/tests/src/Unit/WorkflowTest.php
index 3d242a10227de57d7838b3e4ae5745336e8f506a..63bf2f08ed7854f0ec6046f222ada1ad04776702 100644
--- a/core/modules/workflows/tests/src/Unit/WorkflowTest.php
+++ b/core/modules/workflows/tests/src/Unit/WorkflowTest.php
@@ -82,8 +82,8 @@ public function testGetStates() {
     $workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
 
     // Getting states works when there are none.
-    $this->assertArrayEquals([], array_keys($workflow->getTypePlugin()->getStates()));
-    $this->assertArrayEquals([], array_keys($workflow->getTypePlugin()->getStates([])));
+    $this->assertSame([], $workflow->getTypePlugin()->getStates());
+    $this->assertSame([], $workflow->getTypePlugin()->getStates([]));
 
     $workflow
       ->getTypePlugin()
@@ -92,7 +92,7 @@ public function testGetStates() {
       ->addState('archived', 'Archived');
 
     // States are stored in alphabetical key order.
-    $this->assertArrayEquals([
+    $this->assertEquals([
       'archived',
       'draft',
       'published',
@@ -102,21 +102,21 @@ public function testGetStates() {
     $this->assertInstanceOf(State::class, $workflow->getTypePlugin()->getStates()['draft']);
 
     // Passing in no IDs returns all states.
-    $this->assertArrayEquals(['draft', 'published', 'archived'], array_keys($workflow->getTypePlugin()->getStates()));
+    $this->assertEquals(['draft', 'published', 'archived'], array_keys($workflow->getTypePlugin()->getStates()));
 
     // The order of states is by weight.
     $workflow->getTypePlugin()->setStateWeight('published', -1);
-    $this->assertArrayEquals(['published', 'draft', 'archived'], array_keys($workflow->getTypePlugin()->getStates()));
+    $this->assertEquals(['published', 'draft', 'archived'], array_keys($workflow->getTypePlugin()->getStates()));
 
     // The label is also used for sorting if weights are equal.
     $workflow->getTypePlugin()->setStateWeight('archived', 0);
-    $this->assertArrayEquals(['published', 'archived', 'draft'], array_keys($workflow->getTypePlugin()->getStates()));
+    $this->assertEquals(['published', 'archived', 'draft'], array_keys($workflow->getTypePlugin()->getStates()));
 
     // You can limit the states returned by passing in states IDs.
-    $this->assertArrayEquals(['archived', 'draft'], array_keys($workflow->getTypePlugin()->getStates(['draft', 'archived'])));
+    $this->assertEquals(['archived', 'draft'], array_keys($workflow->getTypePlugin()->getStates(['draft', 'archived'])));
 
     // An empty array does not load all states.
-    $this->assertArrayEquals([], array_keys($workflow->getTypePlugin()->getStates([])));
+    $this->assertSame([], $workflow->getTypePlugin()->getStates([]));
   }
 
   /**
@@ -394,8 +394,8 @@ public function testGetTransitions() {
     $workflow = new Workflow(['id' => 'test', 'type' => 'test_type'], 'workflow');
 
     // Getting transitions works when there are none.
-    $this->assertArrayEquals([], array_keys($workflow->getTypePlugin()->getTransitions()));
-    $this->assertArrayEquals([], array_keys($workflow->getTypePlugin()->getTransitions([])));
+    $this->assertSame([], $workflow->getTypePlugin()->getTransitions());
+    $this->assertSame([], $workflow->getTypePlugin()->getTransitions([]));
 
     // By default states are ordered in the order added.
     $workflow
@@ -406,29 +406,29 @@ public function testGetTransitions() {
       ->addTransition('a_a', 'A to A', ['a'], 'a');
 
     // Transitions are stored in alphabetical key order in configuration.
-    $this->assertArrayEquals(['a_a', 'a_b'], array_keys($workflow->getTypePlugin()->getConfiguration()['transitions']));
+    $this->assertEquals(['a_a', 'a_b'], array_keys($workflow->getTypePlugin()->getConfiguration()['transitions']));
 
     // Ensure we're returning transition objects.
     $this->assertInstanceOf(Transition::class, $workflow->getTypePlugin()->getTransitions()['a_a']);
 
     // Passing in no IDs returns all transitions.
-    $this->assertArrayEquals(['a_b', 'a_a'], array_keys($workflow->getTypePlugin()->getTransitions()));
+    $this->assertEquals(['a_b', 'a_a'], array_keys($workflow->getTypePlugin()->getTransitions()));
 
     // The order of states is by weight.
     $workflow->getTypePlugin()->setTransitionWeight('a_a', -1);
-    $this->assertArrayEquals(['a_a', 'a_b'], array_keys($workflow->getTypePlugin()->getTransitions()));
+    $this->assertEquals(['a_a', 'a_b'], array_keys($workflow->getTypePlugin()->getTransitions()));
 
     // If all weights are equal it will fallback to labels.
     $workflow->getTypePlugin()->setTransitionWeight('a_a', 0);
-    $this->assertArrayEquals(['a_a', 'a_b'], array_keys($workflow->getTypePlugin()->getTransitions()));
+    $this->assertEquals(['a_a', 'a_b'], array_keys($workflow->getTypePlugin()->getTransitions()));
     $workflow->getTypePlugin()->setTransitionLabel('a_b', 'A B');
-    $this->assertArrayEquals(['a_b', 'a_a'], array_keys($workflow->getTypePlugin()->getTransitions()));
+    $this->assertEquals(['a_b', 'a_a'], array_keys($workflow->getTypePlugin()->getTransitions()));
 
     // You can limit the states returned by passing in states IDs.
-    $this->assertArrayEquals(['a_a'], array_keys($workflow->getTypePlugin()->getTransitions(['a_a'])));
+    $this->assertEquals(['a_a'], array_keys($workflow->getTypePlugin()->getTransitions(['a_a'])));
 
     // An empty array does not load all states.
-    $this->assertArrayEquals([], array_keys($workflow->getTypePlugin()->getTransitions([])));
+    $this->assertSame([], $workflow->getTypePlugin()->getTransitions([]));
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php b/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
index e0ac9089c5f2e424dd166fa548e1d31b68b7d898..64c0963004c24fbe71168e9cec38af758a727e8f 100644
--- a/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
+++ b/core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
@@ -172,7 +172,7 @@ public function testSetQueue() {
       ->setQueue('BatchName', '\Drupal\Core\Queue\Batch')
       ->toArray();
 
-    $this->assertArrayEquals([
+    $this->assertEquals([
       'name' => 'BatchName',
       'class' => '\Drupal\Core\Queue\Batch',
     ], $batch['queue'], 'Batch queue has been set.');
diff --git a/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php b/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php
index 6ffacdd78545d867b6f5aa1a6dfed2f31dbec738..c281ebf4816e7a9df344483080b24e87c339d973 100644
--- a/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/NullStorageTest.php
@@ -22,7 +22,7 @@ public function testCollection() {
     $this->assertInstanceOf(StorageInterface::class, $collection);
     $this->assertEquals(StorageInterface::DEFAULT_COLLECTION, $nullStorage->getCollectionName());
     $this->assertEquals('test', $collection->getCollectionName());
-    $this->assertArrayEquals([], $collection->getAllCollectionNames());
+    $this->assertSame([], $collection->getAllCollectionNames());
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php b/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
index 0d140527297f503276d2c79eb997904f9616f31e..3b0f780779608bd1f34751e278d28e6a84d52b34 100644
--- a/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/StorageCopyTraitTest.php
@@ -28,7 +28,7 @@ public function testReplaceStorageContents($source_collections, $target_collecti
     $source = new MemoryStorage();
     $target = new MemoryStorage();
     // Empty the storage should be the same.
-    $this->assertArrayEquals(self::toArray($source), self::toArray($target));
+    $this->assertEquals(self::toArray($source), self::toArray($target));
 
     // When the source is populated, they are not the same any more.
     $this->generateRandomData($source, $source_collections);
@@ -54,9 +54,9 @@ public function testReplaceStorageContents($source_collections, $target_collecti
     // After copying they are the same, this asserts that items not present
     // in the source get removed from the target.
     self::replaceStorageContents($source, $target);
-    $this->assertArrayEquals($source_data, self::toArray($target));
+    $this->assertEquals($source_data, self::toArray($target));
     // Assert that the copy method did indeed not change the source.
-    $this->assertArrayEquals($source_data, self::toArray($source));
+    $this->assertEquals($source_data, self::toArray($source));
 
     // Assert that the active collection is the same as the original source.
     $this->assertEquals($source_name, $source->getCollectionName());
@@ -154,7 +154,7 @@ public function testWithInvalidConfiguration() {
         $this->assertFalse($target->exists($name));
       }
       else {
-        $this->assertArrayEquals($source->read($name), $target->read($name));
+        $this->assertEquals($source->read($name), $target->read($name));
       }
     }
 
diff --git a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
index 04f5eb1cb4716e40a3f1bf61028e00364856dcc9..09c938f3b1ff197c91b122e7d79854057647b538 100644
--- a/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
+++ b/core/tests/Drupal/Tests/Core/Datetime/DateTest.php
@@ -412,7 +412,7 @@ public function testFormattedDateDiff() {
         'max-age' => $max_age,
       ],
     ];
-    $this->assertArrayEquals($expected, $object->toRenderable());
+    $this->assertEquals($expected, $object->toRenderable());
 
     // Test retrieving the formatted time difference string.
     $this->assertEquals($string, $object->getString());
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
index 74a9129c6dd42075594cc007cbd99026f037509e..3e1efe049e72fe762e7e739414254ac51a895456 100644
--- a/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
@@ -598,7 +598,7 @@ public function testGetFields($expected, $include_computed, $is_computed, $field
       ->willReturnArgument(0);
 
     // Exercise getFields().
-    $this->assertArrayEquals(
+    $this->assertEquals(
       $expected,
       $mock_base->getFields($include_computed)
     );
diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
index 4afbfe18b6e6b8bc8597142ecf5cfa85a5ca3791..cb427f6a20a66a517f83db9c2a4a06aa5cc1ece0 100644
--- a/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
+++ b/core/tests/Drupal/Tests/Core/Entity/EntityConstraintViolationListTest.php
@@ -27,7 +27,7 @@ public function testFilterByFields() {
 
     $this->assertSame($constraint_list->filterByFields(['name']), $constraint_list);
     $this->assertCount(4, $constraint_list);
-    $this->assertArrayEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
+    $this->assertEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
   }
 
   /**
@@ -42,7 +42,7 @@ public function testFilterByFieldsWithCompositeConstraints() {
 
     $this->assertSame($constraint_list->filterByFields(['name']), $constraint_list);
     $this->assertCount(4, $constraint_list);
-    $this->assertArrayEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
+    $this->assertEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
   }
 
   /**
@@ -57,7 +57,7 @@ public function testFilterByFieldAccess() {
 
     $this->assertSame($constraint_list->filterByFieldAccess($account), $constraint_list);
     $this->assertCount(4, $constraint_list);
-    $this->assertArrayEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
+    $this->assertEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
   }
 
   /**
@@ -72,7 +72,7 @@ public function testFilterByFieldAccessWithCompositeConstraint() {
 
     $this->assertSame($constraint_list->filterByFieldAccess($account), $constraint_list);
     $this->assertCount(4, $constraint_list);
-    $this->assertArrayEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
+    $this->assertEquals(array_values(iterator_to_array($constraint_list)), [$violations[2], $violations[3], $violations[4], $violations[5]]);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
index fbd522230316b35aeec87f0f0dcfdb3528dbe83c..0fc8e36b993fafcfe2ca22d32dc7b228c8eaeed9 100644
--- a/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
+++ b/core/tests/Drupal/Tests/Core/Field/FieldItemListTest.php
@@ -349,7 +349,7 @@ public function testDefaultValuesFormSubmit() {
     $field_list->expects($this->never())
       ->method('getValue');
 
-    $this->assertArrayEquals([], $field_list->defaultValuesFormSubmit([], $form, $form_state));
+    $this->assertSame([], $field_list->defaultValuesFormSubmit([], $form, $form_state));
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
index 975e3e4ece95dc7ad6abf376f7eca6043868705a..a8f61b45b09633c0484ca6676995c6dd6b47e910 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/Discovery/DerivativeDiscoveryDecoratorTest.php
@@ -212,7 +212,7 @@ public function testExistingDerivative() {
 
     $expected = $definitions['non_container_aware_discovery'];
     $expected['id'] = 'non_container_aware_discovery:test_discovery_1';
-    $this->assertArrayEquals($expected, $returned_definitions['non_container_aware_discovery:test_discovery_1']);
+    $this->assertEquals($expected, $returned_definitions['non_container_aware_discovery:test_discovery_1']);
   }
 
   /**
@@ -252,7 +252,7 @@ public function testSingleExistingDerivative() {
 
     $expected = $base_definition;
     $expected['id'] = 'non_container_aware_discovery:test_discovery_1';
-    $this->assertArrayEquals($expected, $discovery->getDefinition('non_container_aware_discovery:test_discovery_1'));
+    $this->assertEquals($expected, $discovery->getDefinition('non_container_aware_discovery:test_discovery_1'));
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
index 81a1312198c0792bcd642f9d2db4b90963eb6c5c..9107cb90727a6c1b2724502473051763ac4a9274 100644
--- a/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
+++ b/core/tests/Drupal/Tests/Core/Template/AttributeTest.php
@@ -94,7 +94,7 @@ public function testSetAttribute() {
     // Test adding array to class.
     $attribute = new Attribute();
     $attribute->setAttribute('class', ['kitten', 'cat']);
-    $this->assertArrayEquals(['kitten', 'cat'], $attribute['class']->value());
+    $this->assertEquals(['kitten', 'cat'], $attribute['class']->value());
 
     // Test adding boolean attributes.
     $attribute = new Attribute();
@@ -174,19 +174,19 @@ public function testAddClasses() {
 
     // Add one class on empty attribute.
     $attribute->addClass('banana');
-    $this->assertArrayEquals(['banana'], $attribute['class']->value());
+    $this->assertEquals(['banana'], $attribute['class']->value());
 
     // Add one class.
     $attribute->addClass('aa');
-    $this->assertArrayEquals(['banana', 'aa'], $attribute['class']->value());
+    $this->assertEquals(['banana', 'aa'], $attribute['class']->value());
 
     // Add multiple classes.
     $attribute->addClass('xx', 'yy');
-    $this->assertArrayEquals(['banana', 'aa', 'xx', 'yy'], $attribute['class']->value());
+    $this->assertEquals(['banana', 'aa', 'xx', 'yy'], $attribute['class']->value());
 
     // Add an array of classes.
     $attribute->addClass(['red', 'green', 'blue']);
-    $this->assertArrayEquals(['banana', 'aa', 'xx', 'yy', 'red', 'green', 'blue'], $attribute['class']->value());
+    $this->assertEquals(['banana', 'aa', 'xx', 'yy', 'red', 'green', 'blue'], $attribute['class']->value());
 
     // Add an array of duplicate classes.
     $attribute->addClass(['red', 'green', 'blue'], ['aa', 'aa', 'banana'], 'yy');
@@ -218,7 +218,7 @@ public function testRemoveClasses() {
     $attribute->removeClass('gg');
     $this->assertNotContains(['gg'], $attribute['class']->value());
     // Test that the array index remains sequential.
-    $this->assertArrayEquals(['aa'], $attribute['class']->value());
+    $this->assertEquals(['aa'], $attribute['class']->value());
 
     $attribute->removeClass('aa');
     $this->assertEmpty((string) $attribute);
@@ -254,7 +254,7 @@ public function testChainAddRemoveClasses() {
       ->addClass(['apple', 'lime', 'grapefruit'])
       ->addClass(['banana']);
     $expected = ['example-class', 'blue', 'apple', 'lime', 'grapefruit', 'banana'];
-    $this->assertArrayEquals($expected, $attribute['class']->value(), 'Attributes chained');
+    $this->assertEquals($expected, $attribute['class']->value(), 'Attributes chained');
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php b/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php
index ccb00ff82c9b69ac501fab41c806a5aef8f45c54..7ae45e2fe8f89804aac8dae7e98dfeec28144db8 100644
--- a/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/JUnitConverterTest.php
@@ -49,7 +49,7 @@ public function testXmlToRowsWithErrors() {
   public function testXmlToRowsEmptyFile() {
     // File system with an empty XML file.
     vfsStream::setup('junit_test', NULL, ['empty.xml' => '']);
-    $this->assertArrayEquals([], JUnitConverter::xmlToRows(23, vfsStream::url('junit_test/empty.xml')));
+    $this->assertSame([], JUnitConverter::xmlToRows(23, vfsStream::url('junit_test/empty.xml')));
   }
 
   /**
@@ -76,7 +76,7 @@ public function testXmlElementToRows() {
         'file' => '/Users/paul/projects/drupal/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php',
       ],
     ];
-    $this->assertArrayEquals($simpletest, JUnitConverter::xmlElementToRows(23, new \SimpleXMLElement($junit)));
+    $this->assertEquals($simpletest, JUnitConverter::xmlElementToRows(23, new \SimpleXMLElement($junit)));
   }
 
   /**
@@ -96,7 +96,7 @@ public function testConvertTestCaseToSimpletestRow() {
       'line' => 108,
       'file' => '/Users/paul/projects/drupal/core/modules/simpletest/tests/src/Unit/TestDiscoveryTest.php',
     ];
-    $this->assertArrayEquals($simpletest, JUnitConverter::convertTestCaseToSimpletestRow(23, new \SimpleXMLElement($junit)));
+    $this->assertEquals($simpletest, JUnitConverter::convertTestCaseToSimpletestRow(23, new \SimpleXMLElement($junit)));
   }
 
 }
diff --git a/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php b/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php
index 4086368f276d1af89aa389b01dbf991ae7011a7f..21a38e9e11d1e6ac2ac236e63a3329d19f285fb4 100644
--- a/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/RunTests/TestFileParserTest.php
@@ -81,11 +81,11 @@ public function testParseContents($expected, $contents) {
    */
   public function testGetTestListFromFile() {
     $parser = new TestFileParser();
-    $this->assertArrayEquals(
+    $this->assertEquals(
       ['Drupal\Tests\Core\Test\RunTests\TestFileParserTest'],
       $parser->getTestListFromFile(__FILE__)
     );
-    $this->assertArrayEquals(
+    $this->assertEquals(
       ['Drupal\KernelTests\Core\Datetime\Element\TimezoneTest'],
       $parser->getTestListFromFile(__DIR__ . '/../../../../KernelTests/Core/Datetime/Element/TimezoneTest.php')
     );
diff --git a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
index c10c484647f9320f0e33864462ed71a06b4e7739..41e95e4283470af6c61fb2913229c60c8f9d2a9e 100644
--- a/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Theme/RegistryTest.php
@@ -190,7 +190,7 @@ public function testPostProcessExtension($defined_functions, $hooks, $expected)
     $reflection_method->setAccessible(TRUE);
     $reflection_method->invokeArgs($this->registry, [&$hooks, $theme->reveal()]);
 
-    $this->assertArrayEquals($expected, $hooks);
+    $this->assertEquals($expected, $hooks);
   }
 
   /**
diff --git a/core/tests/Drupal/Tests/UnitTestCase.php b/core/tests/Drupal/Tests/UnitTestCase.php
index 55978ba413c8fe9dd0c3bc5002732704b0da4358..3a4e035ce06082031a41b5c8ae382da12c9241cc 100644
--- a/core/tests/Drupal/Tests/UnitTestCase.php
+++ b/core/tests/Drupal/Tests/UnitTestCase.php
@@ -87,8 +87,14 @@ protected function getRandomGenerator() {
    * @param array $expected
    * @param array $actual
    * @param string $message
+   *
+   * @deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use
+   *   ::assertEquals, ::assertEqualsCanonicalizing, or ::assertSame instead.
+   *
+   * @see https://www.drupal.org/node/3136304
    */
   protected function assertArrayEquals(array $expected, array $actual, $message = NULL) {
+    @trigger_error(__METHOD__ . "() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::assertEquals(), ::assertEqualsCanonicalizing(), or ::assertSame() instead. See https://www.drupal.org/node/3136304", E_USER_DEPRECATED);
     ksort($expected);
     ksort($actual);
     $this->assertEquals($expected, $actual, !empty($message) ? $message : '');
diff --git a/core/tests/Drupal/Tests/UnitTestCaseTest.php b/core/tests/Drupal/Tests/UnitTestCaseTest.php
new file mode 100644
index 0000000000000000000000000000000000000000..d01264de6616ad2bc437c58468000f9c821f9cdd
--- /dev/null
+++ b/core/tests/Drupal/Tests/UnitTestCaseTest.php
@@ -0,0 +1,22 @@
+<?php
+
+namespace Drupal\Tests;
+
+/**
+ * Tests for the UnitTestCase class.
+ *
+ * @group Tests
+ */
+class UnitTestCaseTest extends UnitTestCase {
+
+  /**
+   * Tests deprecation of the ::assertArrayEquals method.
+   *
+   * @group legacy
+   * @expectedDeprecation Drupal\Tests\UnitTestCase::assertArrayEquals() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use ::assertEquals(), ::assertEqualsCanonicalizing(), or ::assertSame() instead. See https://www.drupal.org/node/3136304
+   */
+  public function testAssertArrayEquals() {
+    $this->assertArrayEquals([], []);
+  }
+
+}