public function testErrorWithCss()
 {
     $text = " div { font-weight: bold; } ";
     $template = new Template();
     $template->parse($text);
     $nodelist = $template->getRoot()->getNodelist();
     $this->assertEquals($text, $template->render());
     $this->assertInternalType('string', $nodelist[0]);
 }
Example #2
0
 public function testSetRootInConstructors()
 {
     $tp2 = new Template(Tst::$tests . 'files/templates');
     $this->assertEquals(Tst::$tests . 'files/templates', $tp2->getRoot()[0]);
 }
 public function testWithBlock()
 {
     $template = new Template();
     $template->parse('  {% comment %}  {% endcomment %} ');
     $nodelist = $template->getRoot()->getNodelist();
     $this->assertEquals(3, count($nodelist));
     $this->assertInternalType('string', $nodelist[0]);
     $this->assertInstanceOf('\\Liquid\\Tag\\TagComment', $nodelist[1]);
     $this->assertInternalType('string', $nodelist[2]);
 }