You are here

public function InspectorTest::testAssertAllStrictArrays in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php \Drupal\Tests\Component\Assertion\InspectorTest::testAssertAllStrictArrays()

Tests asserting all members are strict arrays.

@covers ::assertAllStrictArrays

File

core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php, line 106
Contains \Drupal\Tests\Component\Assertion\InspectorTest.

Class

InspectorTest
@coversDefaultClass \Drupal\Component\Assertion\Inspector @group Assertion

Namespace

Drupal\Tests\Component\Assertion

Code

public function testAssertAllStrictArrays() {
  $this
    ->assertTrue(Inspector::assertAllStrictArrays([]));
  $this
    ->assertTrue(Inspector::assertAllStrictArrays([
    [],
    [],
  ]));
  $this
    ->assertFalse(Inspector::assertAllStrictArrays([
    [
      'foo' => 'bar',
      'bar' => 'foo',
    ],
  ]));
}