public function testCompatibilityWithZF2View()
 {
     $renderer = new PhpRenderer();
     $helpers = new HelperPluginManager();
     $name = $this->jobleadsHelper->getName();
     $helpers->setInvokableClass($name, get_class($this->jobleadsHelper));
     $renderer->setHelperPluginManager($helpers);
     $this->assertEquals(self::EXPECTED_RETURN, $renderer->{$name}());
 }
 public function testCanCreateServiceWithName()
 {
     $moduleOptions = new ModuleOptions(['view_helpers' => ['headLink' => ['proxy' => TestProxy::class]]]);
     $sm = new ServiceManager();
     $sm->setService(ModuleOptions::class, $moduleOptions);
     $viewHelperManager = new HelperPluginManager();
     $viewHelperManager->setServiceLocator($sm);
     $viewHelperManager->setInvokableClass(TestProxy::class, TestProxy::class);
     $factory = new ViewHelperProxyAbstractFactory();
     $this->assertTrue($factory->canCreateServiceWithName($viewHelperManager, TestProxy::class, TestProxy::class));
     $this->assertFalse($factory->canCreateServiceWithName($viewHelperManager, 'not-exist', 'not-exist'));
 }
Example #3
0
 /**
  * Set invokable class
  *
  * @param  string  $name
  * @param  string  $invokableClass
  * @return $this
  */
 public function registerPlugin($name, $invokableClass)
 {
     $this->hpm->setInvokableClass($name, $invokableClass);
     return $this;
 }