/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->versionService = $this->serviceManager->get(VersionService::class); $version = new Version(); $version->setId(1); $versionType = new Type(); $versionType->setDescription('This is the description'); $version->setVersionType($versionType); $this->versionService->setVersion($version); $project = new Project(); $project->setProject('This is the project'); $this->projectService = $this->serviceManager->get(ProjectService::class); // $this->projectService->setProject($project); $this->projectService->setProjectId(1); $this->versionService->getVersion()->setProject($this->projectService->getProject()); $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock(); $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager = $this->serviceManager->get('viewhelpermanager'); $viewHelperManager->setService('isAllowed', $authorizeServiceMock); $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock(); $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager->setService('url', $urlViewHelperMock); $this->versionLink = $viewHelperManager->get('versionlink'); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $this->formService = new FormService(); $this->formService->setServiceLocator($this->serviceManager); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->projectLogo = $this->serviceManager->get('viewhelpermanager')->get('projectlogo'); $this->projectService = $this->serviceManager->get(ProjectService::class); $this->projectService->setProjectId(1); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->document = new Document(); $this->document->setId(1); $this->document->setDocument('This is the document'); $contentType = new ContentType(); $contentType->setExtension('.xyz'); $this->document->setContentType($contentType); $project = new Project(); $project->setId(1); $project->setNumber('1234'); $project->setProject('This is the number'); $workpackage = new Workpackage(); $workpackage->setSequence(1); $workpackage->setProject($project); $this->document->setWorkpackage($workpackage); $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock(); $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager = $this->serviceManager->get('viewhelpermanager'); $viewHelperManager->setService('isAllowed', $authorizeServiceMock); $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock(); $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager->setService('url', $urlViewHelperMock); $this->documentLink = $viewHelperManager->get('workpackageDocumentlink'); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $this->generalService = new GeneralService(); $this->generalService->setEntityManager($this->entityManager); $this->generalService->setAdminService($this->serviceManager->get(AdminService::class)); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $this->inviteService = $this->serviceManager->get(InviteService::class); $application = $this->serviceManager->get('application'); // $application->bootstrap(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $this->createMergedDocument = new CreateMergedDocument(); $pluginManager = new PluginManager(); $pluginManager->setServiceLocator($this->serviceManager); $this->createMergedDocument->setServiceLocator($pluginManager); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->ideaImage = $this->serviceManager->get('viewhelpermanager')->get('ideaImage'); $idea = new Idea(); $idea->setId(1); $idea->setIdea('This is the idea'); $this->image = new Image(); $this->image->setId(1); $this->image->setIdea($idea); $contentType = new ContentType(); $contentType->setExtension('jpg'); $this->image->setContentType($contentType); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->projectService = $this->serviceManager->get(ProjectService::class); $this->projectService->setProjectId(1); $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock(); $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager = $this->serviceManager->get('viewhelpermanager'); $viewHelperManager->setService('isAllowed', $authorizeServiceMock); $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock(); $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager->setService('url', $urlViewHelperMock); $this->projectLink = $viewHelperManager->get('projectLink'); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $idea = new Idea(); $idea->setId(1); $idea->setNumber(123123); $idea->setIdea('This is the idea'); $this->ideaService = $this->serviceManager->get(IdeaService::class); $this->ideaService->setIdea($idea); $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock(); $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager = $this->serviceManager->get('viewhelpermanager'); $viewHelperManager->setService('isAllowed', $authorizeServiceMock); $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock(); $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager->setService('url', $urlViewHelperMock); $this->ideaLink = $this->serviceManager->get('viewhelpermanager')->get('idealink'); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->invite = new Invite(); $this->invite->setId(1); $this->invite->setInvite('This is the invite'); $deeplink = new Deeplink(); $custom = new Custom(); $custom->setEmail('*****@*****.**'); $deeplink->setCustom($custom); $this->invite->setDeeplink($deeplink); $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock(); $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager = $this->serviceManager->get('viewhelpermanager'); $viewHelperManager->setService('isAllowed', $authorizeServiceMock); $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock(); $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager->setService('url', $urlViewHelperMock); $this->inviteLink = $viewHelperManager->get('invitelink'); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->report = new Report(); $this->report->setId(1); $this->report->setDatePeriod(new \DateTime()); $project = new Project(); $project->setId(1); $project->setNumber('1234'); $project->setProject('This is the number'); $this->report->setProject($project); $authorizeServiceMock = $this->getMockBuilder('BjyAuthorize\\View\\Helper\\IsAllowed')->disableOriginalConstructor()->getMock(); $authorizeServiceMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager = $this->serviceManager->get('viewhelpermanager'); $viewHelperManager->setService('isAllowed', $authorizeServiceMock); $urlViewHelperMock = $this->getMockBuilder(Url::class)->disableOriginalConstructor()->getMock(); $urlViewHelperMock->expects($this->any())->method('__invoke')->will($this->returnValue(true)); $viewHelperManager->setService('url', $urlViewHelperMock); $this->reportLink = $viewHelperManager->get('reportLink'); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->filterCreateObject = new FilterCreateObject(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->entityManager = $this->serviceManager->get('doctrine.entitymanager.orm_default'); $this->versionService = $this->serviceManager->get(VersionService::class); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->objectFieldset = new ObjectFieldset($this->serviceManager->get('doctrine.entitymanager.orm_default'), new Project()); }
$zf2Path = $vendorPath . '/ZF2/library'; } elseif (is_dir($vendorPath . '/zendframework')) { $zf2Path = $vendorPath . '/zendframework'; } } if (!$zf2Path) { throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or' . ' define a ZF2_PATH environment variable.'); } if (file_exists($vendorPath . '/autoload.php')) { include $vendorPath . '/autoload.php'; } include $zf2Path . '/zend-loader/src/AutoloaderFactory.php'; AutoloaderFactory::factory(array('Zend\\Loader\\StandardAutoloader' => array('autoregister_zf' => true, 'namespaces' => array(__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__)))); } protected static function findParentPath($path) { $dir = __DIR__; $previousDir = '.'; while (!is_dir($dir . '/' . $path)) { $dir = dirname($dir); if ($previousDir === $dir) { return false; } $previousDir = $dir; } return $dir . '/' . $path; } } Bootstrap::init(); Bootstrap::chroot();
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->module = new \Project\Module(); }
/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); }
{ $vendorPath = static::findParentPath('vendor'); $zf2Path = getenv('ZF2_PATH'); if (!$zf2Path) { if (defined('ZF2_PATH')) { $zf2Path = ZF2_PATH; } elseif (is_dir($vendorPath . '/ZF2/library')) { $zf2Path = $vendorPath . '/ZF2/library'; } elseif (is_dir($vendorPath . '/zendframework/zendframework/library')) { $zf2Path = $vendorPath . '/zendframework/zendframework/library'; } } if (!$zf2Path) { throw new RuntimeException('Unable to load ZF2. Run `php composer.phar install` or define a ZF2_PATH environment variable.'); } if (file_exists($vendorPath . '/autoload.php')) { include $vendorPath . '/autoload.php'; } include $zf2Path . '/Zend/Loader/AutoloaderFactory.php'; AutoloaderFactory::factory(['Zend\\Loader\\StandardAutoloader' => ['autoregister_zf' => true, 'namespaces' => [__NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__, 'Zend' => __DIR__ . '/' . __NAMESPACE__]]]); } /** * @return ServiceManager */ public static function getServiceManager() { return static::$serviceManager; } } Bootstrap::init();