function InspectorTest::providerTestAssertAllStrings
File
- 
              core/
tests/ Drupal/ Tests/ Component/ Assertion/ InspectorTest.php, line 44  
Class
- InspectorTest
 - @coversDefaultClass \Drupal\Component\Assertion\Inspector[[api-linebreak]] @group Assertion
 
Namespace
Drupal\Tests\Component\AssertionCode
public static 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;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.