/** * {@inheritDoc} */ public function setUp() { $this->serviceManager = Bootstrap::getServiceManager(); $this->call = new Call(); $this->call->setId(1); $this->call->setCall('This is the call'); $program = new Program(); $program->setProgram('This is the program'); $this->call->setProgram($program); $this->authorizeService = $this->serviceManager->get('BjyAuthorize\\Service\\Authorize'); if (!$this->authorizeService->getAcl()->hasResource($this->call)) { $this->authorizeService->getAcl()->addResource($this->call); $this->authorizeService->getAcl()->allow([], $this->call, []); } /** * Add the resource on the fly */ if (!$this->authorizeService->getAcl()->hasResource(new Call())) { $this->authorizeService->getAcl()->addResource(new Call()); } $this->authorizeService->getAcl()->allow([], new Call(), []); $this->callLink = $this->serviceManager->get('viewhelpermanager')->get('calllink'); /** * Bootstrap the application to have the other information available */ $application = $this->serviceManager->get('application'); $application->bootstrap(); }
/** * {@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(); }
public function testCanCreateDifferentIdeaLinks() { $call = new Call(); $call->setId(1); $this->assertContains('<a href', $this->ideaLink->__invoke($this->ideaService, 'view')); }