예제 #1
0
 public function testPriorities()
 {
     $this->init();
     $this->assertCount(3, $this->inlineScript);
     $this->assertEquals('/js/bootstrap.min.js', $this->inlineScript->offsetGet(0)->attributes['src']);
     $this->assertEquals('/js/jquery.min.js', $this->inlineScript->offsetGet(1)->attributes['src']);
     $this->assertEquals('/js/main.min.js', $this->inlineScript->offsetGet(2)->attributes['src']);
 }
예제 #2
0
 /**
  * Find and initialize GoogleAnalytic helper before rendering inline scripts.
  * 
  * @see \Zend\View\Helper\HeadScript::toString()
  * @param string $indent
  * @return string
  */
 public function toString($indent = null)
 {
     $helperManager = $this->getView()->getHelperPluginManager();
     if ($helperManager->has('googleAnalytic')) {
         $googleAnalytic = $helperManager->get('googleAnalytic');
         $googleAnalytic->initialize();
     }
     return parent::toString();
 }
예제 #3
0
 public function testInlineScriptReturnsObjectInstance()
 {
     $placeholder = $this->helper->__invoke();
     $this->assertTrue($placeholder instanceof Helper\InlineScript);
 }