Skip to content

Commit

Permalink
test travis ci
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelroecker committed Dec 27, 2015
1 parent 82bbe7c commit f8e4aca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 54 deletions.
55 changes: 2 additions & 53 deletions tests/GlValidatorTest.php
Expand Up @@ -27,21 +27,6 @@
*/
class GlValidatorTest extends \PHPUnit_Framework_TestCase
{
private function file_get_contents_utf8($filename)
{
$opts = array(
'http' => array(
'method' => "GET",
'header' => "Content-Type: text/html; charset=utf-8"
)
);

$context = stream_context_create($opts);
$result = @file_get_contents($filename, false, $context);

return $result;
}

public function testHtml()
{
$finder = new Finder();
Expand Down Expand Up @@ -90,32 +75,7 @@ function (SplFileInfo $file) use (&$count) {
$src = __DIR__ . "/expected/" . $file;
$dst = __DIR__ . "/result/" . $file;


$expectedDom = new \DomDocument();
$expectedDom->loadHTMLFile($src);
$expectedDom->preserveWhiteSpace = false;

$actualDom = new \DomDocument();
$actualDom->loadHTMLFile($dst);
$actualDom->preserveWhiteSpace = false;

$this->assertEquals($expectedDom->saveHTML(), $actualDom->saveHTML());

/*
$srccontent = file_get_contents($src);
$dstcontent = file_get_contents($dst);
$srcencoding = mb_detect_encoding($srccontent);
$dstencoding = mb_detect_encoding($dstcontent);
$this->assertEquals(0, strcmp($srccontent, $dstcontent),"$srcencoding\n\n$dstencoding");
*/
//$this->assertEquals($srcencoding, $dstencoding, "$src:$srcencoding different to $dst:$dstencoding ");

//$this->assertEquals($srccontent, $dstcontent, "$src different to $dst");

//print_r($srccontent);
//print_r($dstcontent);
$this->assertFileEquals($src, $dst);
}
}

Expand Down Expand Up @@ -181,18 +141,7 @@ function (SplFileInfo $file) use (&$count) {
$src = __DIR__ . "/expected/" . $file;
$dst = __DIR__ . "/result/" . $file;

$srccontent = file_get_contents($src);
$dstcontent = file_get_contents($dst);

$srcencoding = mb_detect_encoding($srccontent);
$dstencoding = mb_detect_encoding($dstcontent);

$this->assertEquals($srcencoding, $dstencoding, "$src:$srcencoding different to $dst:$dstencoding ");

$this->assertEquals($srccontent, $dstcontent, "$src different to $dst");

//var_dump($srccontent);
//var_dump($dstcontent);
$this->assertFileEquals($src, $dst);
}
}
}
2 changes: 1 addition & 1 deletion tests/expected/test1/w3c_html_index.html
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link href="icon.png" rel="icon"/><link href="style.css" rel="stylesheet"/><title>Showing results for uploaded file index.html - Nu Html Checker</title><meta name="viewport" content="width=device-width, initial-scale=1"/><style type="text/css" media="all">@import url("https://validator.w3.org/nu/style.css");</style></head><body><h2>test1\index.html</h2><ol><li class="info"><p><strong>Info</strong>: <span>The Content-Type was <code>text/html</code>. Using the HTML parser.</span></p></li><li class="info"><p><strong>Info</strong>: <span>Using the schema for HTML with SVG 1.1, MathML 3.0, RDFa 1.1, and ITS 2.0 support.</span></p></li></ol><p class="success">The document validates according to the specified schema(s) and to additional constraints checked by the validator.</p></body></html>
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link href="icon.png" rel="icon"/><link href="style.css" rel="stylesheet"/><title>Showing results for uploaded file index.html - Nu Html Checker</title><meta name="viewport" content="width=device-width, initial-scale=1"/><style type="text/css" media="all">@import url("https://validator.w3.org/nu/style.css");</style></head><body><h2>test1\index.html</h2><ol><li class="info"><p><strong>Info</strong>: <span>The Content-Type was <code>text/html</code>. Using the HTML parser.</span></p></li><li class="info"><p><strong>Info</strong>: <span>Using the schema for HTML with SVG 1.1, MathML 3.0, RDFa 1.1, and ITS 2.0 support.</span></p></li></ol><p class="success">The document validates according to the specified schema(s) and to additional constraints checked by the validator.</p></body></html>

0 comments on commit f8e4aca

Please sign in to comment.