Skip to content

Commit 93b4b8e

Browse files
committed
Added test for mapping option alias
1 parent fdc3a3b commit 93b4b8e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

tests/Dflydev/Pimple/Provider/DoctrineOrm/DoctrineOrmServiceProviderTest.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)