Skip to content
Snippets Groups Projects
Commit dd9b069f authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge remote-tracking branch 'refs/remotes/origin/stable' into origin-hotline-master

parents 3361bf1a a7b3041a
Branches
Tags
2 merge requests!2080Sandbox detach zf from storm,!2061Master
Pipeline #9 failed with stage
in 1 second
......@@ -243,19 +243,26 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe
if ($content == null)
$content = $this->_response->getBody();
$httpClient = (new Zend_Http_Client('http://sandbox.pergame.net/html-validator/'))
if (!$nu_validator_url = getenv('BOKEH_HTML_VALIDATOR_URL'))
$nu_validator_url ='https://validator.w3.org/nu/';
$httpClient = (new Zend_Http_Client($nu_validator_url))
->setMethod(Zend_Http_Client::POST)
->setHeaders('Content-Type', 'text/html; charset=utf-8')
->setEncType(Zend_Http_Client::ENC_FORMDATA)
->setParameterPost('content', $content);
->setParameterGet('out', 'text')
->setRawData($content);
$response = $httpClient->request()->getBody();
$content_lines = explode("\n", $content);
$content_with_lines = "HTML:\n";
$content_with_lines = "HTML from: " . $nu_validator_url ."\n";
foreach($content_lines as $i => $line) {
$content_with_lines .= sprintf("%4s %s\n", $i + 1, $line);
}
$this->assertContains('No errors found', $response, $content_with_lines);
$this->assertNotContains('Error: ',
$response,
$content_with_lines);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment