Completed
Push — EZP-31681 ( 54659b...e049ce )
by
unknown
18:38 queued 10s
created

HostTextNormalizerTest::testNormalize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20

Duplication

Lines 20
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 20
loc 20
rs 9.6
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer;
8
9
use eZ\Publish\Core\MVC\Symfony\Component\Serializer\HostTextNormalizer;
10
use eZ\Publish\Core\MVC\Symfony\Component\Tests\Serializer\Stubs\SerializerStub;
11
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher;
12
use eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\HostText;
13
use eZ\Publish\Core\Search\Tests\TestCase;
14
15 View Code Duplication
final class HostTextNormalizerTest extends TestCase
0 ignored issues
show
Duplication introduced by
This class 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...
16
{
17
    public function testNormalize()
18
    {
19
        $normalizer = new HostTextNormalizer();
20
        $normalizer->setSerializer(new SerializerStub());
21
22
        $matcher = new HostText([
23
            'prefix' => 'foo',
24
            'suffix' => 'bar',
25
        ]);
26
27
        $this->assertEquals(
28
            [
29
                'siteAccessesConfiguration' => [
30
                    'prefix' => 'foo',
31
                    'suffix' => 'bar',
32
                ],
33
            ],
34
            $normalizer->normalize($matcher)
35
        );
36
    }
37
38
    public function testSupportsNormalization()
39
    {
40
        $normalizer = new HostTextNormalizer();
41
42
        $this->assertTrue($normalizer->supportsNormalization($this->createMock(HostText::class)));
43
        $this->assertFalse($normalizer->supportsNormalization($this->createMock(Matcher::class)));
44
    }
45
}
46