コード例 #1
0
ファイル: ProgramLinkTest.php プロジェクト: debranova/program
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->program = new Program();
     $this->program->setId(1);
     $this->program->setProgram('This is the program');
     $this->authorizeService = $this->serviceManager->get('BjyAuthorize\\Service\\Authorize');
     if (!$this->authorizeService->getAcl()->hasResource($this->program)) {
         $this->authorizeService->getAcl()->addResource($this->program);
         $this->authorizeService->getAcl()->allow([], $this->program, []);
     }
     /**
      * Add the resource on the fly
      */
     if (!$this->authorizeService->getAcl()->hasResource(new Program())) {
         $this->authorizeService->getAcl()->addResource(new Program());
     }
     $this->authorizeService->getAcl()->allow([], new Program(), []);
     $this->programLink = $this->serviceManager->get('viewhelpermanager')->get('programlink');
     $routeMatch = new RouteMatch(['program' => 1]);
     $routeMatch->setMatchedRouteName('route-program_entity_program');
     $this->programLink->setRouteMatch($routeMatch);
     /**
      * Bootstrap the application to have the other information available
      */
     $application = $this->serviceManager->get('application');
     $application->bootstrap();
 }
コード例 #2
0
ファイル: DoaLinkTest.php プロジェクト: debranova/program
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->doa = new Doa();
     $this->doa->setId(1);
     $program = new Program();
     $program->setId(1);
     $program->setProgram('Program');
     $this->doa->setProgram($program);
     $organisation = new Organisation();
     $organisation->setId(1);
     $organisation->setOrganisation("Organisation");
     $this->doa->setOrganisation($organisation);
     $this->authorizeService = $this->serviceManager->get('BjyAuthorize\\Service\\Authorize');
     if (!$this->authorizeService->getAcl()->hasResource($this->doa)) {
         $this->authorizeService->getAcl()->addResource($this->doa);
         $this->authorizeService->getAcl()->allow([], $this->doa, []);
     }
     /**
      * Add the resource on the fly
      */
     if (!$this->authorizeService->getAcl()->hasResource(new Doa())) {
         $this->authorizeService->getAcl()->addResource(new Doa());
     }
     $this->authorizeService->getAcl()->allow([], new Doa(), []);
     $this->doaLink = $this->serviceManager->get('viewhelpermanager')->get('programDoaLink');
     /**
      * Bootstrap the application to have the other information available
      */
     $application = $this->serviceManager->get('application');
     $application->bootstrap();
 }
コード例 #3
0
ファイル: NdaLinkTest.php プロジェクト: iteaoffice/program
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $this->serviceManager = Bootstrap::getServiceManager();
     $this->nda = new Nda();
     $this->nda->setId(1);
     $contact = new Contact();
     $contact->setId(1234);
     $this->nda->setContact($contact);
     $program = new Program();
     $program->setId(1);
     $program->setProgram('Program');
     $call = new Call();
     $call->setId(1);
     $call->setCall("Call");
     $call->setProgram($program);
     $this->nda->setCall(new ArrayCollection([$call]));
     $this->ndaLink = $this->serviceManager->get('viewhelpermanager')->get('ndaLink');
     /**
      * Bootstrap the application to have the other information available
      */
     $application = $this->serviceManager->get('application');
     $application->bootstrap();
 }