Esempio n. 1
0
 /**
  * Setup
  */
 public function setUp()
 {
     $this->formManager = \Mockery::mock('StrokerForm\\FormManager');
     $this->renderer = new Renderer();
     $this->renderer->setRulePluginManager(new RulePluginManager());
     $this->renderer->setFormManager($this->formManager);
     $this->view = new PhpRenderer();
     $this->routerMock = \Mockery::mock('Zend\\Mvc\\Router\\SimpleRouteStack')->shouldReceive('assemble')->byDefault()->getMock();
     $this->translatorMock = \Mockery::mock('Zend\\I18n\\Translator\\Translator')->shouldReceive('translate')->andReturnUsing(function ($string) {
         return $string;
     })->getMock();
     $this->rendererOptions = new \StrokerForm\Renderer\JqueryValidate\Options();
     $this->renderer->setHttpRouter($this->routerMock);
     $this->renderer->setTranslator($this->translatorMock);
     $this->renderer->setDefaultOptions($this->rendererOptions);
 }
Esempio n. 2
0
 /**
  * Create service
  *
  * @param ServiceLocatorInterface $serviceLocator
  * @return mixed
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $renderer = new Renderer();
     $pluginManager = new RulePluginManager();
     $pluginManager->setServiceLocator($serviceLocator);
     $renderer->setRulePluginManager($pluginManager);
     return $renderer;
 }