/** * Move this to here to have config cache working * @return array */ public function getControllerPluginConfig() { return ['factories' => ['renderNda' => function ($sm) { $renderNda = new RenderNda(); $renderNda->setServiceLocator($sm->getServiceLocator()); return $renderNda; }, 'renderProgramDoa' => function ($sm) { $renderDoa = new RenderDoa(); $renderDoa->setServiceLocator($sm->getServiceLocator()); return $renderDoa; }]]; }
/** * Move this to here to have config cache working. * * @return array */ public function getControllerPluginConfig() { return ['invokables' => ['getProgramFilter' => Plugin\GetFilter::class], 'factories' => ['renderNda' => function (PluginManager $sm) { $renderNda = new RenderNda(); $renderNda->setServiceLocator($sm->getServiceLocator()); return $renderNda; }, 'renderProgramDoa' => function (PluginManager $sm) { $renderDoa = new RenderDoa(); $renderDoa->setServiceLocator($sm->getServiceLocator()); return $renderDoa; }, 'renderSession' => function (PluginManager $sm) { $renderSession = new RenderSession(); $renderSession->setServiceLocator($sm->getServiceLocator()); return $renderSession; }]]; }
public function testCanRenderDoa() { /** * Bootstrap the application to have the other information available */ $renderDoa = new RenderDoa(); $renderDoa->setServiceLocator($this->serviceManager); $contact = new Contact(); $contact->setFirstName('Johan'); $contact->setLastName('van der Heide'); $program = new Program(); $program->setProgram('testProgram'); $doa = new Doa(); $doa->setContact($contact); $doa->setProgram($program); $pdf = $renderDoa->renderForDoa($doa); $this->assertInstanceOf("Program\\Controller\\Plugin\\ProgramPdf", $pdf); $this->assertTrue(strlen($pdf->getPDFData()) > 0); }