function StringBaseTest::testSaveWithoutStorage
Same name and namespace in other branches
- 9 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()
- 11.x 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 <a href="/api/drupal/core%21modules%21locale%21src%21StringBase.php/class/StringBase/8.9.x" title="Defines the locale string base class." class="local">\Drupal\locale\StringBase</a> @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();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.