protected function getValidationError($htmlChunk)
    {
        $this->markTestSkipped('No validator');
        return "oh noes, no validator existed";
        $html = <<<HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>title</title></head>
<body>
{$htmlChunk}
</body></html>
HTML;
        $validator = new HtmlValidator(Config::W3C_SOAP_API);
        if ($validator->isValid($html)) {
            return false;
        }
        $result = $validator->getErrors();
        return $result[0];
    }
Esempio n. 2
0
 /**
  * testCheckTrue.
  */
 public function testCheckTrue()
 {
     $htmlValidator = new HtmlValidator();
     $this->assertNull($htmlValidator->check('chuck norris', '/chuck/'));
 }
Esempio n. 3
0
 function Validate()
 {
     $validator = new HtmlValidator();
     $result = $validator->Validate($this->mFormattedComment);
     if ($result === true) {
         return true;
     } else {
         $this->mError .= $result;
         return false;
     }
 }
Esempio n. 4
0
 function serializeToVars($prefix)
 {
     HtmlValidator::serializeToVars($prefix);
     reset($this->po_entries);
     $i = 0;
     while ($poe = each($this->po_entries)) {
         $poe = $poe[1];
         $poe->serializeToVars($prefix . "_POE{$i}");
         $i++;
     }
 }