Example #1
0
 /** @dataProvider getGetDoctypeTriggersWarningWhenInvalidData */
 public function testGetDoctypeTriggersWarningWhenInvalid($format, $msg)
 {
     $node = new Doctype(array('lineno' => 0, 'column' => 0), 'invalid', null);
     $e = null;
     try {
         $node->getDoctype($format);
     } catch (\Exception $e) {
     }
     $this->assertNotNull($e);
     $this->assertInstanceOf('PHPUnit_Framework_Error_Warning', $e);
     $this->assertSame($msg, $e->getMessage());
 }
Example #2
0
 public function enterDoctype(Doctype $doctype)
 {
     $str = 'doctype(';
     $str .= $doctype->getDoctypeId() ?: 'default';
     if ($options = $doctype->getOptions()) {
         $str .= ', ' . $options;
     }
     $str .= ')';
     $this->write($str);
 }
 public function enterDoctype(Doctype $node)
 {
     $doctype = $node->getDoctype($this->env->getOption('format'));
     $this->write($this->escapeLanguage($doctype));
 }