Completed
Pull Request — master (#540)
by Daniel
10:54
created

BlogFunctionalTest::testBlogWithMultibyteUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
class BlogFunctionalTest extends FunctionalTest
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
4
{
5
    protected static $fixture_file = 'BlogFunctionalTest.yml';
6
7
    protected static $use_draft_site = true;
8
9
    public function setUp()
10
    {
11
        Config::inst()->update('URLSegmentFilter', 'default_allow_multibyte', true);
12
13
        parent::setUp();
14
15
        i18n::set_locale('fa_IR');
16
    }
17
18
    public function testBlogWithMultibyteUrl()
19
    {
20
        $result = $this->get('آبید');
21
22
        $this->assertEquals(200, $result->getStatusCode());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<BlogFunctionalTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
23
    }
24
25
    public function testMemberProfileWithMultibyteUrlAndName()
26
    {
27
        $result = $this->get('آبید/profile/عبّاس-آبان');
28
29
        $this->assertEquals(200, $result->getStatusCode());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<BlogFunctionalTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
30
        $this->assertContains('My Blog Post', $result->getBody());
31
    }
32
33
    public function testMemberProfileWithMultibyteUrlAndEnglishName()
34
    {
35
        $result = $this->get('آبید/profile/bob-jones');
36
37
        $this->assertEquals(200, $result->getStatusCode());
0 ignored issues
show
Bug introduced by
The method assertEquals() does not seem to exist on object<BlogFunctionalTest>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
38
        $this->assertContains('My Blog Post', $result->getBody());
39
    }
40
}
41