Example #1
0
 public function test_can_add_a_new_namespace_to_default_connection()
 {
     $this->registry->shouldReceive('getManager')->once()->with('default')->andReturn($this->em);
     $configuration = m::mock(Configuration::class);
     $mappingDriver = m::mock(MappingDriverChain::class);
     $mappingDriver->shouldReceive('addNamespace')->once()->with('NewNamespace');
     $configuration->shouldReceive('getMetadataDriverImpl')->once()->andReturn($mappingDriver);
     $this->em->shouldReceive('getConfiguration')->once()->andReturn($configuration);
     $this->manager->addNamespace('NewNamespace', 'default');
 }
Example #2
0
 /**
  * 
  *
  * @param $namespace
  * @param bool|false $connection
  * @static 
  */
 public static function addNamespace($namespace, $connection = false)
 {
     return \LaravelDoctrine\ORM\DoctrineManager::addNamespace($namespace, $connection);
 }