public function CacheTest::testValidateTags in Drupal 8
@covers ::validateTags
@dataProvider validateTagsProvider @expectedDeprecation Drupal\Core\Cache\Cache::validateTags() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use assert(\Drupal\Component\Assertion\Inspector::assertAllStrings($tags)) instead. @group legacy
File
- core/
tests/ Drupal/ Tests/ Core/ Cache/ CacheTest.php, line 50
Class
- CacheTest
- @coversDefaultClass \Drupal\Core\Cache\Cache @group Cache
Namespace
Drupal\Tests\Core\CacheCode
public function testValidateTags(array $tags, $expected_exception_message) {
if ($expected_exception_message !== FALSE) {
$this
->expectException('LogicException');
$this
->expectExceptionMessage($expected_exception_message);
}
// If it doesn't throw an exception, validateTags() returns NULL.
$this
->assertNull(Cache::validateTags($tags));
}