You are here

public function InspectorTest::providerTestAssertAllStrings in Zircon Profile 8.0

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

File

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

Class

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

Namespace

Drupal\Tests\Component\Assertion

Code

public function providerTestAssertAllStrings() {
  $data = [
    'empty-array' => [
      [],
      TRUE,
    ],
    'array-with-strings' => [
      [
        'foo',
        'bar',
      ],
      TRUE,
    ],
    'string' => [
      'foo',
      FALSE,
    ],
    'array-with-strings-with-colon' => [
      [
        'foo',
        'bar',
        'llama:2001988',
        'baz',
        'llama:14031991',
      ],
      TRUE,
    ],
    'with-FALSE' => [
      [
        FALSE,
      ],
      FALSE,
    ],
    'with-TRUE' => [
      [
        TRUE,
      ],
      FALSE,
    ],
    'with-string-and-boolean' => [
      [
        'foo',
        FALSE,
      ],
      FALSE,
    ],
    'with-NULL' => [
      [
        NULL,
      ],
      FALSE,
    ],
    'string-with-NULL' => [
      [
        'foo',
        NULL,
      ],
      FALSE,
    ],
    'integer' => [
      [
        1337,
      ],
      FALSE,
    ],
    'string-and-integer' => [
      [
        'foo',
        1337,
      ],
      FALSE,
    ],
    'double' => [
      [
        3.14,
      ],
      FALSE,
    ],
    'string-and-double' => [
      [
        'foo',
        3.14,
      ],
      FALSE,
    ],
    'array' => [
      [
        [],
      ],
      FALSE,
    ],
    'string-and-array' => [
      [
        'foo',
        [],
      ],
      FALSE,
    ],
    'string-and-nested-array' => [
      [
        'foo',
        [
          'bar',
        ],
      ],
      FALSE,
    ],
    'object' => [
      [
        new \stdClass(),
      ],
      FALSE,
    ],
    'string-and-object' => [
      [
        'foo',
        new StringObject(),
      ],
      FALSE,
    ],
  ];
  return $data;
}