Completed
Push — master ( a42587...ffbd82 )
by Nikola
12:36
created

NamerCollectionTest::firstDifferentWins()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 24
rs 8.9714
cc 1
eloc 13
nc 1
nop 0
1
<?php
2
/*
3
 * This file is part of the Doctrine Naming Strategy Bundle, an RunOpenCode project.
4
 *
5
 * (c) 2015 RunOpenCode
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace RunOpenCode\Bundle\DoctrineNamingStrategy\Tests\NamingStrategy;
11
12
use RunOpenCode\Bundle\DoctrineNamingStrategy\NamingStrategy\NamerCollection;
13
use RunOpenCode\Bundle\DoctrineNamingStrategy\NamingStrategy\UnderscoredClassNamespacePrefix;
14
15
class NamerCollectionTest extends \PHPUnit_Framework_TestCase
16
{
17
    /**
18
     * @test
19
     */
20
    public function firstDifferentWins()
21
    {
22
        $namer = new NamerCollection(
23
            new UnderscoredClassNamespacePrefix(array(
24
                'map' => array(
25
                    'RunOpenCode\\Bundle\\TestNamespace\\Entity' => 'my_prefix'
26
                )
27
            )),
28
            array(
29
                new UnderscoredClassNamespacePrefix(array(
30
                    'map' => array(
31
                        'RunOpenCode\\Bundle\\TestNamespace\\Entity' => 'my_other_prefix'
32
                    )
33
                )),
34
                new UnderscoredClassNamespacePrefix(array(
35
                    'map' => array(
36
                        'RunOpenCode\\Bundle\\TestNamespace\\Entity' => 'totaly_different_prefix'
37
                    )
38
                ))
39
            )
40
        );
41
42
        $this->assertSame('my_other_prefix_some_class', $namer->classToTableName('RunOpenCode\\Bundle\\TestNamespace\\Entity\\SomeClass'));
43
    }
44
}
45
46