You are here

public function ArrayDiffUnitTest::testArrayDiffAssocRecursive in Drupal 7

Tests drupal_array_diff_assoc_recursive().

File

modules/simpletest/tests/common.test, line 3209
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);
}