/** * {@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'); }
/** * @return Type */ public function provider() { $type = new Type(); $type->setType('version-type'); $type->setDescription('version-type-description'); return [[$type]]; }
/** * @param ObjectManager $manager */ public function load(ObjectManager $manager) { $versionType = new Type(); $versionType->setType(Type::TYPE_PO); $versionType->setDescription('This is a project outline'); $manager->persist($versionType); $versionType = new Type(); $versionType->setType(Type::TYPE_FPP); $versionType->setDescription('This is a full project proposal'); $manager->persist($versionType); $versionType = new Type(); $versionType->setType(Type::TYPE_CR); $versionType->setDescription('This is a change request'); $manager->persist($versionType); $versionType = new Type(); $versionType->setType(Type::TYPE_SR); $versionType->setDescription('This is a stop request'); $manager->persist($versionType); $manager->flush(); }