You are here

public function InspectorTest::testAssertStrictArray in Drupal 9

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

Tests asserting array is 0-indexed - the strict definition of array.

@covers ::assertStrictArray

File

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

Class

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

Namespace

Drupal\Tests\Component\Assertion

Code

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