@@ 70-82 (lines=13) @@ | ||
67 | /** |
|
68 | * @test |
|
69 | */ |
|
70 | public function blacklisted() |
|
71 | { |
|
72 | $strategy = new UnderscoredBundleNamePrefix($this->mockKernel(), array( |
|
73 | 'map' => array( |
|
74 | 'DoctrineNamingStrategyBundle' => 'my_prefix' |
|
75 | ), |
|
76 | 'blacklist' => array( |
|
77 | 'DoctrineNamingStrategyBundle' |
|
78 | ) |
|
79 | )); |
|
80 | ||
81 | $this->assertSame('some_entity', $strategy->classToTableName('RunOpenCode\\Bundle\\DoctrineNamingStrategy\\Entity\\SomeEntity')); |
|
82 | } |
|
83 | ||
84 | /** |
|
85 | * @test |
@@ 33-43 (lines=11) @@ | ||
30 | /** |
|
31 | * @test |
|
32 | */ |
|
33 | public function classToTableNameUppercase() |
|
34 | { |
|
35 | $strategy = new UnderscoredClassNamespacePrefix(array( |
|
36 | 'map' => array( |
|
37 | 'RunOpenCode\\Bundle\\TestNamespace\\Entity' => 'my_prefix' |
|
38 | ), |
|
39 | 'case' => CASE_UPPER |
|
40 | )); |
|
41 | ||
42 | $this->assertSame('MY_PREFIX_SOME_ENTITY', $strategy->classToTableName('RunOpenCode\\Bundle\\TestNamespace\\Entity\\SomeEntity')); |
|
43 | } |
|
44 | ||
45 | /** |
|
46 | * @test |
|
@@ 68-80 (lines=13) @@ | ||
65 | /** |
|
66 | * @test |
|
67 | */ |
|
68 | public function blacklisted() |
|
69 | { |
|
70 | $strategy = new UnderscoredClassNamespacePrefix(array( |
|
71 | 'map' => array( |
|
72 | 'RunOpenCode\\Bundle\\TestNamespace\\Entity' => 'my_prefix' |
|
73 | ), |
|
74 | 'blacklist' => array( |
|
75 | 'RunOpenCode\\Bundle' |
|
76 | ) |
|
77 | )); |
|
78 | ||
79 | $this->assertSame('some_entity', $strategy->classToTableName('RunOpenCode\\Bundle\\DoctrineNamingStrategy\\Entity\\SomeEntity')); |
|
80 | } |
|
81 | ||
82 | /** |
|
83 | * @test |
|
@@ 85-97 (lines=13) @@ | ||
82 | /** |
|
83 | * @test |
|
84 | */ |
|
85 | public function whitelisted() |
|
86 | { |
|
87 | $strategy = new UnderscoredClassNamespacePrefix(array( |
|
88 | 'map' => array( |
|
89 | 'RunOpenCode\\Bundle\\TestNamespace\\Entity' => 'my_prefix' |
|
90 | ), |
|
91 | 'whitelist' => array( |
|
92 | 'Test\\Bundle2' |
|
93 | ) |
|
94 | )); |
|
95 | ||
96 | $this->assertSame('some_entity', $strategy->classToTableName('RunOpenCode\\Bundle\\DoctrineNamingStrategy\\Entity\\SomeEntity')); |
|
97 | } |
|
98 | } |
|
99 |