Skip to content

Commit

Permalink
[tag_categories] tests for category/tag splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Dec 14, 2024
1 parent 5e4d53e commit 37d10a6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ext/tag_categories/test.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

declare(strict_types=1);

namespace Shimmie2;

use PHPUnit\Framework\Attributes\Depends;

class TagCategoriesTest extends ShimmiePHPUnitTestCase
{
public function testParsing(): void
{
$this->assertEquals("artist", TagCategories::get_tag_category("artist:bob"));
$this->assertEquals("bob", TagCategories::get_tag_body("artist:bob"));

$this->assertEquals(null, TagCategories::get_tag_category("bob"));
$this->assertEquals("bob", TagCategories::get_tag_body("bob"));

$this->assertEquals(null, TagCategories::get_tag_category("notacategory:bob"));
$this->assertEquals("notacategory:bob", TagCategories::get_tag_body("notacategory:bob"));
}
}

0 comments on commit 37d10a6

Please sign in to comment.