/** * @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; }
/** * @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() ); }
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); }
/** * @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); }
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); }