Esempio n. 1
0
    public function testValidate()
    {
        $original_directory = getcwd();
        chdir('..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..');
        $xHtml = <<<END
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
</body>
</html>
END;
        $this->assertTrue(PageView::validate($xHtml));
        $xHtml = <<<END
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>
</head>
<body>
</body>
</html>
END;
        $this->assertFalse(PageView::validate($xHtml));
        chdir($original_directory);
    }