You are here

protected function DiffArrayTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php \Drupal\Tests\Core\Common\DiffArrayTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php \Drupal\Tests\Core\Common\DiffArrayTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Common/DiffArrayTest.php, line 29

Class

DiffArrayTest
Tests the DiffArray helper class.

Namespace

Drupal\Tests\Core\Common

Code

protected function setUp() : void {
  parent::setUp();
  $this->array1 = [
    'same' => 'yes',
    'different' => 'no',
    'array_empty_diff' => [],
    'null' => NULL,
    'int_diff' => 1,
    'array_diff' => [
      'same' => 'same',
      'array' => [
        'same' => 'same',
      ],
    ],
    'array_compared_to_string' => [
      'value',
    ],
    'string_compared_to_array' => 'value',
    'new' => 'new',
  ];
  $this->array2 = [
    'same' => 'yes',
    'different' => 'yes',
    'array_empty_diff' => [],
    'null' => NULL,
    'int_diff' => '1',
    'array_diff' => [
      'same' => 'different',
      'array' => [
        'same' => 'same',
      ],
    ],
    'array_compared_to_string' => 'value',
    'string_compared_to_array' => [
      'value',
    ],
  ];
}