File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
tests/Dflydev/Pimple/Provider/DoctrineOrm Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -282,4 +282,31 @@ public function testInvalidMappingAsOption()
282282
283283 $ app ['orm.ems.config ' ];
284284 }
285+
286+ /**
287+ * Test if namespace alias can be set through the mapping options
288+ */
289+ public function testMappingAlias ()
290+ {
291+ $ app = $ this ->createMockDefaultApp ();
292+
293+ $ doctrineOrmServiceProvider = new DoctrineOrmServiceProvider ;
294+ $ doctrineOrmServiceProvider ->register ($ app );
295+
296+ $ alias = 'Foo ' ;
297+ $ namespace = 'Foo\Entities ' ;
298+
299+ $ app ['orm.em.options ' ] = array (
300+ 'mappings ' => array (
301+ array (
302+ 'type ' => 'annotation ' ,
303+ 'namespace ' => $ namespace ,
304+ 'path ' => __DIR__ .'/src/Foo/Entities ' ,
305+ 'alias ' => $ alias
306+ )
307+ ),
308+ );
309+
310+ $ this ->assertEquals ($ namespace , $ app ['orm.em.config ' ]->getEntityNameSpace ($ alias ));
311+ }
285312}
You can’t perform that action at this time.
0 commit comments