public function InspectorTest::testAssertAllStringable in Drupal 10
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php \Drupal\Tests\Component\Assertion\InspectorTest::testAssertAllStringable()
- 9 core/tests/Drupal/Tests/Component/Assertion/InspectorTest.php \Drupal\Tests\Component\Assertion\InspectorTest::testAssertAllStringable()
Tests asserting all members are strings or objects with __toString().
@covers ::assertAllStringable
File
- core/
tests/ Drupal/ Tests/ Component/ Assertion/ InspectorTest.php, line 72 - Contains \Drupal\Tests\Component\Assertion\InspectorTest.
Class
- InspectorTest
- @coversDefaultClass \Drupal\Component\Assertion\Inspector @group Assertion
Namespace
Drupal\Tests\Component\AssertionCode
public function testAssertAllStringable() {
$this
->assertTrue(Inspector::assertAllStringable([]));
$this
->assertTrue(Inspector::assertAllStringable([
'foo',
'bar',
]));
$this
->assertFalse(Inspector::assertAllStringable('foo'));
$this
->assertTrue(Inspector::assertAllStringable([
'foo',
new StringObject(),
]));
}