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'); }
/** * * * @param $namespace * @param bool|false $connection * @static */ public static function addNamespace($namespace, $connection = false) { return \LaravelDoctrine\ORM\DoctrineManager::addNamespace($namespace, $connection); }