| 1 | <?php |
||
| 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 |