예제 #1
0
 /**
  * @param null $indent
  * @return string
  */
 public function toString($indent = null)
 {
     $metaString = parent::toString($indent);
     // add raw items
     $separator = $this->_escape($this->getSeparator()) . $indent;
     $metaString .= $separator . implode($separator, $this->rawItems);
     return $metaString;
 }
예제 #2
0
  /**
  * @group ZF-9743
  */
 public function testPropertyIsSupportedWithRdfaDoctype()
 {
     $this->view->doctype('XHTML1_RDFA');
     $this->helper->__invoke('foo', 'og:title', 'property');
     $this->assertEquals('<meta property="og:title" content="foo" />',
                         $this->helper->toString()
                        );
 }
예제 #3
0
 public function testStringRepresentationReflectsDoctype()
 {
     $this->view->doctype('HTML4_STRICT');
     $this->helper->headMeta('some content', 'foo');
     $test = $this->helper->toString();
     $this->assertNotContains('/>', $test);
     $this->assertContains('some content', $test);
     $this->assertContains('foo', $test);
 }
예제 #4
0
 /**
  * @group ZF-5435
  */
 public function testContainerMaintainsCorrectOrderOfItems()
 {
     $this->helper->offsetSetName(1, 'keywords', 'foo');
     $this->helper->offsetSetName(10, 'description', 'foo');
     $this->helper->offsetSetHttpEquiv(20, 'pragma', 'baz');
     $this->helper->offsetSetHttpEquiv(5, 'Cache-control', 'baz');
     $test = $this->helper->toString();
     $expected = '<meta name="keywords" content="foo" />' . PHP_EOL . '<meta http-equiv="Cache-control" content="baz" />' . PHP_EOL . '<meta name="description" content="foo" />' . PHP_EOL . '<meta http-equiv="pragma" content="baz" />';
     $this->assertEquals($expected, $test);
 }
예제 #5
0
    public function testIndentationIsHonored()
    {
        $this->helper->setIndent(4);
        $this->helper->appendName('keywords', 'foo bar');
        $this->helper->appendName('seo', 'baz bat');
        $string = $this->helper->toString();

        $scripts = substr_count($string, '    <meta name=');
        $this->assertEquals(2, $scripts);
    }