public function testCustomFunctions()
 {
     $app = $this->createMockDefaultApp();
     $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider();
     $doctrineOrmServiceProvider->register($app);
     $numericFunction = $this->getMock('Doctrine\\ORM\\Query\\AST\\Functions\\FunctionNode', array(), array('mynum'));
     $stringFunction = $this->getMock('Doctrine\\ORM\\Query\\AST\\Functions\\FunctionNode', array(), array('mynum'));
     $datetimeFunction = $this->getMock('Doctrine\\ORM\\Query\\AST\\Functions\\FunctionNode', array(), array('mynum'));
     $app['orm.custom.functions.string'] = array('mystring' => $numericFunction);
     $app['orm.custom.functions.numeric'] = array('mynumeric' => $stringFunction);
     $app['orm.custom.functions.datetime'] = array('mydatetime' => $datetimeFunction);
     $this->assertEquals($numericFunction, $app['orm.em.config']->getCustomStringFunction('mystring'));
     $this->assertEquals($numericFunction, $app['orm.em.config']->getCustomNumericFunction('mynumeric'));
     $this->assertEquals($numericFunction, $app['orm.em.config']->getCustomDatetimeFunction('mydatetime'));
 }
 /**
  * Test if namespace alias can be set through the mapping options
  */
 public function testMappingAlias()
 {
     $app = $this->createMockDefaultApp();
     $doctrineOrmServiceProvider = new DoctrineOrmServiceProvider();
     $doctrineOrmServiceProvider->register($app);
     $alias = 'Foo';
     $namespace = 'Foo\\Entities';
     $app['orm.em.options'] = array('mappings' => array(array('type' => 'annotation', 'namespace' => $namespace, 'path' => __DIR__ . '/src/Foo/Entities', 'alias' => $alias)));
     $this->assertEquals($namespace, $app['orm.em.config']->getEntityNameSpace($alias));
 }