public function test_can_add_paths_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('addPaths')->once()->with(['paths']); $configuration->shouldReceive('getMetadataDriverImpl')->once()->andReturn($mappingDriver); $this->em->shouldReceive('getConfiguration')->once()->andReturn($configuration); $this->manager->addPaths(['paths'], 'default'); }
/** * @param DoctrineManager $manager * @param Gate $gate * @param PermissionManager $permissionManager */ public function boot(DoctrineManager $manager, Gate $gate, PermissionManager $permissionManager) { if (!$this->isLumen()) { $this->publishes([$this->getConfigPath() => config_path('acl.php')], 'config'); } $manager->extendAll(RegisterMappedEventSubscribers::class); if ($permissionManager->needsDoctrine()) { $manager->addPaths([__DIR__ . DIRECTORY_SEPARATOR . 'Permissions']); } $this->definePermissions($gate, $permissionManager); }
/** * @param DoctrineManager $manager */ public function boot(DoctrineManager $manager) { // The path to PasswordReminder should be added, so the entity can be found $manager->addPaths([__DIR__]); }
/** * * * @param array $paths * @param bool|false $connection * @static */ public static function addPaths($paths = array(), $connection = false) { return \LaravelDoctrine\ORM\DoctrineManager::addPaths($paths, $connection); }