Exemplo n.º 1
0
 /**
  * @group ZF-12044
  */
 public function testContainerWithoutItemsShouldAlwaysReturnEmptyString()
 {
     $this->assertEquals('', (string) $this->container);
     $this->container->setIndent(4);
     $this->assertEquals('', (string) $this->container);
     $this->container->setPrefix('<ul><li>');
     $this->assertEquals('', (string) $this->container);
     $this->container->setSeparator('</li><li>');
     $this->assertEquals('', (string) $this->container);
     $this->container->setPrefix('</li></ul>');
     $this->assertEquals('', (string) $this->container);
 }
Exemplo n.º 2
0
 public function testIndentationIsHonored()
 {
     $this->container->setIndent(4)->setPrefix("<ul>\n    <li>")->setSeparator("</li>\n    <li>")->setPostfix("</li>\n</ul>");
     $this->container->append('foo');
     $this->container->append('bar');
     $this->container->append('baz');
     $string = $this->container->toString();
     $lis = substr_count($string, "\n        <li>");
     $this->assertEquals(3, $lis);
     $this->assertTrue(strstr($string, "    <ul>\n") ? true : false, $string);
     $this->assertTrue(strstr($string, "\n    </ul>") ? true : false);
 }