function validate($html) { $v = new Services_W3C_HTMLValidator(); $r = $v->validateFragment($html); if (!$r) { return false; } return array('errors' => $r->errors, 'warnings' => $r->warnings); }
/** * @group w3c * @group admin * @group settings_page * @group meta_box * @covers Fergcorp_Countdown_Timer::example_display_meta_box */ public function test_example_display_meta_box() { ob_start(); $this->plugin->example_display_meta_box(); $buffer = ob_get_clean(); require_once 'Services/W3C/HTMLValidator.php'; $v = new Services_W3C_HTMLValidator(); $v->setOptions(array("doctype" => $docType)); $r = $v->validateFragment($this->htmlStart . $buffer . $this->htmlEnd); //print $this->htmlStart.$buffer.$this->htmlEnd; //var_dump($r); $this->assertTrue($r->isValid(), $this->htmlStart . $buffer . $this->htmlEnd); sleep(1); }