diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2023-03-15 14:27:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-15 14:27:10 +0100 |
commit | b8608ee0fd99c85633ebcf4cba80af59df05aac9 (patch) | |
tree | d14f54c36ebeb13ce40636eda709b3536efd54c0 /tests | |
parent | 892a8045ce3fea3a782fda1258537a66f37af235 (diff) | |
parent | db9c322b0c9b41ea6efe602f4f1571a035b7c454 (diff) | |
download | nextcloud-server-b8608ee0fd99c85633ebcf4cba80af59df05aac9.tar.gz nextcloud-server-b8608ee0fd99c85633ebcf4cba80af59df05aac9.zip |
Merge pull request #36899 from nextcloud/backport/36837
[stable25] fix(SystemTagManager): Truncate overlong tag names
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/SystemTag/SystemTagManagerTest.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/lib/SystemTag/SystemTagManagerTest.php b/tests/lib/SystemTag/SystemTagManagerTest.php index 698c2582b83..253efe8fcbe 100644 --- a/tests/lib/SystemTag/SystemTagManagerTest.php +++ b/tests/lib/SystemTag/SystemTagManagerTest.php @@ -260,6 +260,11 @@ class SystemTagManagerTest extends TestCase { $this->tagManager->createTag($name, $userVisible, $userAssignable); } + public function testCreateOverlongName() { + $tag = $this->tagManager->createTag('Zona circundante do Palácio Nacional da Ajuda (Jardim das Damas, Salão de Física, Torre Sineira, Paço Velho e Jardim Botânico)', true, true); + $this->assertSame('Zona circundante do Palácio Nacional da Ajuda (Jardim das Damas', $tag->getName()); // 63 characters but 64 bytes due to "á" + } + /** * @dataProvider oneTagMultipleFlagsProvider */ @@ -282,14 +287,14 @@ class SystemTagManagerTest extends TestCase { $this->assertSameTag($tag2, $tagList[$tag2->getId()]); } - + public function testGetNonExistingTag() { $this->expectException(\OCP\SystemTag\TagNotFoundException::class); $this->tagManager->getTag('nonexist', false, false); } - + public function testGetNonExistingTagsById() { $this->expectException(\OCP\SystemTag\TagNotFoundException::class); @@ -297,7 +302,7 @@ class SystemTagManagerTest extends TestCase { $this->tagManager->getTagsByIds([$tag1->getId(), 100, 101]); } - + public function testGetInvalidTagIdFormat() { $this->expectException(\InvalidArgumentException::class); @@ -392,7 +397,7 @@ class SystemTagManagerTest extends TestCase { $this->assertEmpty($this->tagManager->getAllTags()); } - + public function testDeleteNonExistingTag() { $this->expectException(\OCP\SystemTag\TagNotFoundException::class); |