Code Duplication    Length = 12-12 lines in 2 locations

tests/BlogCategoryTest.php 1 location

@@ 70-81 (lines=12) @@
67
    /**
68
     * @see https://github.com/silverstripe/silverstripe-blog/issues/376
69
     */
70
    public function testAllowMultibyteUrlSegment()
71
    {
72
        $blog = $this->objFromFixture('SiteTree', 'FirstBlog');
73
        $cat = new BlogCategory();
74
        $cat->BlogID = $blog->ID;
75
        $cat->Title = 'تست';
76
        $cat->write();
77
        // urlencoded
78
        $this->assertEquals('%D8%AA%D8%B3%D8%AA', $cat->URLSegment);
79
        $link = Controller::join_links($cat->Blog()->Link(), 'category', '%D8%AA%D8%B3%D8%AA');
80
        $this->assertEquals($link, $cat->getLink());
81
    }
82
83
    public function testCanView()
84
    {

tests/BlogTagTest.php 1 location

@@ 70-81 (lines=12) @@
67
    /**
68
     * @see https://github.com/silverstripe/silverstripe-blog/issues/376
69
     */
70
    public function testAllowMultibyteUrlSegment()
71
    {
72
        $blog = $this->objFromFixture('SiteTree', 'FirstBlog');
73
        $tag = new BlogTag();
74
        $tag->BlogID = $blog->ID;
75
        $tag->Title = 'تست';
76
        $tag->write();
77
        // urlencoded
78
        $this->assertEquals('%D8%AA%D8%B3%D8%AA', $tag->URLSegment);
79
        $link = Controller::join_links($tag->Blog()->Link(), 'tag', '%D8%AA%D8%B3%D8%AA');
80
        $this->assertEquals($link, $tag->getLink());
81
    }
82
83
    /**
84
     * The first blog can be viewed by anybody.