diff options
Diffstat (limited to 'core/modules/locale/tests/src/Kernel/LocaleStringTest.php')
-rw-r--r-- | core/modules/locale/tests/src/Kernel/LocaleStringTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/modules/locale/tests/src/Kernel/LocaleStringTest.php b/core/modules/locale/tests/src/Kernel/LocaleStringTest.php index f5f27b01a627..b007c7ab55b0 100644 --- a/core/modules/locale/tests/src/Kernel/LocaleStringTest.php +++ b/core/modules/locale/tests/src/Kernel/LocaleStringTest.php @@ -258,4 +258,27 @@ class LocaleStringTest extends KernelTestBase { ])->save(); } + /** + * Tests that strings are correctly deleted. + */ + public function testDeleteStrings(): void { + $source = $this->storage->createString([ + 'source' => 'Revision ID', + ])->save(); + + $this->storage->createTranslation([ + 'lid' => $source->lid, + 'language' => 'fr', + 'translation' => 'Translated Revision ID', + ])->save(); + + // Confirm that the string has been created. + $this->assertNotEmpty($this->storage->findString(['lid' => $source->lid])); + + $this->storage->deleteStrings(['lid' => $source->lid]); + + // Confirm that the string has been deleted. + $this->assertEmpty($this->storage->findString(['lid' => $source->lid])); + } + } |