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