public function ArrayDiffUnitTest::testArrayDiffAssocRecursive

Tests drupal_array_diff_assoc_recursive().

File

drupal/modules/simpletest/tests/common.test, line 3144
Tests for common.inc functionality.

Class

ArrayDiffUnitTest
Test array diff functions.

Code

public function testArrayDiffAssocRecursive() {
  $expected = array(
    'different' => 'no',
    'int_diff' => 1,
    // The 'array' key should not be returned, as it's the same.
    'array_diff' => array(
      'same' => 'same',
    ),
    'array_compared_to_string' => array(
      'value',
    ),
    'string_compared_to_array' => 'value',
    'new' => 'new',
  );
  $this
    ->assertIdentical(drupal_array_diff_assoc_recursive($this->array1, $this->array2), $expected);
}