Inheritance: extends Zend\Mvc\Controller\AbstractActionController
 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     if ($serviceLocator instanceof AbstractPluginManager) {
         $serviceLocator = $serviceLocator->getServiceLocator();
     }
     /** @var CommitMapper $mapper */
     $mapper = $serviceLocator->get('commitMapper');
     $instance = new IndexController();
     $instance->setCommitMapper($mapper);
     return $instance;
 }
 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     try {
         $c = new IndexController();
         /**
          * @param ServiceLocatorInterface $parentLocator
          */
         $parentLocator = $serviceLocator->getServiceLocator();
         $c->setGate($parentLocator->get('malocher.cqrs.gate'));
         return $c;
     } catch (\Exception $e) {
         var_dump($e->getMessage());
     }
 }
 /**
  * Tests IndexController->batchsubmitAction()
  */
 public function testBatchsubmitAction()
 {
     // TODO Auto-generated IndexControllerTest->testBatchsubmitAction()
     $this->markTestIncomplete("batchsubmitAction test not implemented");
     $this->indexController->batchsubmitAction();
 }
 public function testIndexAction()
 {
     $viewModel = $this->IndexController->indexAction();
     $this->assertInstanceof('Zend\\View\\Model\\ViewModel', $viewModel);
 }
 public function testIndexActionReturnsViewModel()
 {
     $controller = new IndexController();
     $this->assertInstanceOf(ViewModel::class, $controller->indexAction());
 }
Esempio n. 6
0
    $controller->setInvoiceService($cm->getServiceLocator()->get('Application\\Service\\Invoice'));
    return $controller;
}, 'Application\\Controller\\Customer' => function (ControllerManager $cm) {
    $controller = new CustomerController();
    $controller->setCustomerService($cm->getServiceLocator()->get('Application\\Service\\Customer'));
    return $controller;
}, 'Application\\Controller\\Document' => function (ControllerManager $cm) {
    $controller = new DocumentController();
    $controller->setCustomerService($cm->getServiceLocator()->get('Application\\Service\\Customer'));
    $controller->setCompanyService($cm->getServiceLocator()->get('Application\\Service\\Company'));
    $controller->setSettingsService($cm->getServiceLocator()->get('Application\\Service\\Settings'));
    $controller->setInvoiceService($cm->getServiceLocator()->get('Application\\Service\\Invoice'));
    $controller->setCreditInvoiceService($cm->getServiceLocator()->get('Application\\Service\\CreditInvoice'));
    return $controller;
}, 'Application\\Controller\\Index' => function (ControllerManager $cm) {
    $controller = new IndexController();
    $controller->setLanguageService($cm->getServiceLocator()->get('Application\\Service\\Language'));
    return $controller;
}, 'Application\\Controller\\Settings' => function (ControllerManager $cm) {
    $controller = new SettingsController();
    $controller->setSettingsService($cm->getServiceLocator()->get('Application\\Service\\Settings'));
    return $controller;
}, 'Application\\Controller\\Statistics' => function (ControllerManager $cm) {
    $controller = new StatisticsController();
    $controller->setStatisticsService($cm->getServiceLocator()->get('Application\\Service\\Statistics'));
    return $controller;
}, 'Application\\Controller\\Supplier' => function (ControllerManager $cm) {
    $controller = new SupplierController();
    $controller->setSupplierService($cm->getServiceLocator()->get('Application\\Service\\Supplier'));
    return $controller;
}, 'Application\\Controller\\Template' => function (ControllerManager $cm) {
 public function testConvertion()
 {
     $index = new IndexController();
     // Nothing was done yet:
     $this->assertSame($index->getMethod(), NORMAL);
     $this->assertSame($index->getNumber(), 0);
     $this->assertSame($index->getResult(), 'nulla');
     // Setters and getters:
     $index->setNumber(769);
     $index->setMethod(TRADITIONAL);
     $this->assertSame($index->getNumber(), 769);
     $this->assertSame($index->getMethod(), TRADITIONAL);
     // Generator for medieval numeral:
     $index->setMethod(MEDIEVAL);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'PHOZI');
     // Generator for traditional numeral:
     $index->setMethod(TRADITIONAL);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'DCCLXVIIII');
     // Generator for normal numeral:
     $index->setMethod(NORMAL);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'DCCLXIX');
     // Negative integer:
     $index->setNumber(-2);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'nulla');
     // Rounded float:
     $index->setNumber(10.99);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'XI');
     // Rounded float (2):
     $index->setNumber(10.4999999);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'X');
     // Negative float:
     $index->setNumber(-10.4999999);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'nulla');
     // Large number:
     $index->setNumber(1000000);
     $index->generateRomanNumeral();
     $this->assertSame($index->getResult(), 'nimis magna!');
 }
 /**
  * @covers Application\Controller\IndexController::indexAction
  */
 public function testIndexActionReturnsViewModel()
 {
     $this->assertInstanceOf('Zend\\View\\Model\\ViewModel', $this->indexController->indexAction());
 }
Esempio n. 9
0
 public function testIndexActionCanBeAccessed()
 {
     $this->routeMatch->setParam('action', 'index');
     $this->controller->dispatch($this->request);
     $this->assertEquals(200, $this->controller->getResponse()->getStatusCode());
 }