function UnitTestCase::assertArrayEquals

Asserts if two arrays are equal by sorting them first.

Parameters

array $expected:

array $actual:

string $message:

33 calls to UnitTestCase::assertArrayEquals()
AttributeTest::testAddClasses in core/tests/Drupal/Tests/Core/Template/AttributeTest.php
Tests adding class attributes with the AttributeArray helper method. @covers ::addClass[[api-linebreak]]
AttributeTest::testChainAddRemoveClasses in core/tests/Drupal/Tests/Core/Template/AttributeTest.php
Tests removing class attributes with the Attribute helper methods. @covers ::removeClass[[api-linebreak]] @covers ::addClass[[api-linebreak]]
AttributeTest::testRemoveClasses in core/tests/Drupal/Tests/Core/Template/AttributeTest.php
Tests removing class attributes with the AttributeArray helper method. @covers ::removeClass[[api-linebreak]]
AttributeTest::testSetAttribute in core/tests/Drupal/Tests/Core/Template/AttributeTest.php
Tests setting attributes. @covers ::setAttribute[[api-linebreak]]
BatchBuilderTest::testSetQueue in core/tests/Drupal/Tests/Core/Batch/BatchBuilderTest.php
Tests setQueue().

... See full list

File

core/tests/Drupal/Tests/UnitTestCase.php, line 90

Class

UnitTestCase
Provides a base class and helpers for Drupal unit tests.

Namespace

Drupal\Tests

Code

protected function assertArrayEquals(array $expected, array $actual, $message = NULL) {
  ksort($expected);
  ksort($actual);
  $this->assertEquals($expected, $actual, !empty($message) ? $message : '');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.