Completed
Push — master ( 2b4610...a5af43 )
by Robbie
02:08
created

testGetCategoriesWithMultibyteUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Importance

Changes 0
Metric Value
dl 7
loc 7
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SilverStripe\Blog\Tests\Model;
4
5
use SilverStripe\Core\Config\Config;
6
use SilverStripe\Dev\FunctionalTest;
7
use SilverStripe\i18n\i18n;
8
use SilverStripe\View\Parsers\URLSegmentFilter;
9
10
class BlogControllerFunctionalTest extends FunctionalTest
11
{
12
    protected static $fixture_file = 'BlogControllerFunctionalTest.yml';
13
14
    protected static $use_draft_site = true;
15
16
    protected function setUp()
17
    {
18
        Config::modify()->set(URLSegmentFilter::class, 'default_allow_multibyte', true);
19
        i18n::set_locale('fa_IR');
20
21
        parent::setUp();
22
    }
23
24 View Code Duplication
    public function testGetCategoriesWithMultibyteUrl()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
    {
26
        $result = $this->get('my-blog/category/' . rawurlencode('آبید'));
27
28
        $this->assertEquals(200, $result->getStatusCode());
29
        $this->assertContains('آبید', $result->getBody());
30
    }
31
32 View Code Duplication
    public function testGetTagsWithMultibyteUrl()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
    {
34
        $result = $this->get('my-blog/tag/' . rawurlencode('برتراند'));
35
36
        $this->assertEquals(200, $result->getStatusCode());
37
        $this->assertContains('برتراند', $result->getBody());
38
    }
39
}
40