diff options
author | Marcel Klehr <mklehr@gmx.net> | 2023-02-23 17:34:53 +0100 |
---|---|---|
committer | Marcel Klehr <mklehr@gmx.net> | 2023-02-24 12:55:10 +0100 |
commit | 8151b1b8b04315d7b43329c433a9ef52fe016787 (patch) | |
tree | c50dbddba40f7bd37575cb222a96a0fd6bf2c35a /tests | |
parent | 00a7478d8df2007697d5caf2e0cb1c298afbb3fd (diff) | |
download | nextcloud-server-8151b1b8b04315d7b43329c433a9ef52fe016787.tar.gz nextcloud-server-8151b1b8b04315d7b43329c433a9ef52fe016787.zip |
fix(SystemTagManager): Truncate overlong tag names
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/SystemTag/SystemTagManagerTest.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/lib/SystemTag/SystemTagManagerTest.php b/tests/lib/SystemTag/SystemTagManagerTest.php index ef0546dbd88..3d8d2d843c4 100644 --- a/tests/lib/SystemTag/SystemTagManagerTest.php +++ b/tests/lib/SystemTag/SystemTagManagerTest.php @@ -259,6 +259,14 @@ class SystemTagManagerTest extends TestCase { $this->tagManager->createTag($name, $userVisible, $userAssignable); } + public function testCreateOverlongName() { + try { + $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); + } catch (\Exception $e) { + $this->assertTrue(false, 'No exception thrown for create call'); + } + } + /** * @dataProvider oneTagMultipleFlagsProvider */ @@ -281,14 +289,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); @@ -296,7 +304,7 @@ class SystemTagManagerTest extends TestCase { $this->tagManager->getTagsByIds([$tag1->getId(), 100, 101]); } - + public function testGetInvalidTagIdFormat() { $this->expectException(\InvalidArgumentException::class); @@ -391,7 +399,7 @@ class SystemTagManagerTest extends TestCase { $this->assertEmpty($this->tagManager->getAllTags()); } - + public function testDeleteNonExistingTag() { $this->expectException(\OCP\SystemTag\TagNotFoundException::class); |