You are here

public function InspectorTest::testAssertStrictArray in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 94
Contains \Drupal\Tests\Component\Assertion\InspectorTest.

Class

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

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',
  ]));
}