public function StringBaseTest::testDeleteWithoutStorage in Drupal 10
Same name and namespace in other branches
- 8 core/modules/locale/tests/src/Unit/StringBaseTest.php \Drupal\Tests\locale\Unit\StringBaseTest::testDeleteWithoutStorage()
- 9 core/modules/locale/tests/src/Unit/StringBaseTest.php \Drupal\Tests\locale\Unit\StringBaseTest::testDeleteWithoutStorage()
@covers ::delete
File
- core/
modules/ locale/ tests/ src/ Unit/ StringBaseTest.php, line 28
Class
- StringBaseTest
- @coversDefaultClass \Drupal\locale\StringBase @group locale
Namespace
Drupal\Tests\locale\UnitCode
public function testDeleteWithoutStorage() {
$string = new SourceString([
'lid' => 1,
'source' => 'test',
]);
$this
->expectException(StringStorageException::class);
$this
->expectExceptionMessage('The string cannot be deleted because its not bound to a storage: test');
$string
->delete();
}