22 protected function setUp()
24 $this->pageContent =
'';
25 $p = popen(
'php '. dirname(__DIR__).
'/ui/index.php 2>&1',
'r');
27 $line = fgets($p, 1000);
28 $this->pageContent .= $line;
33 private function assertCriticalStringNotfound($critical) {
34 $criticalPos = strpos($this->pageContent, $critical);
35 $criticalEnd = $criticalPos===
false ? $criticalPos : strpos($this->pageContent,
"\n", $criticalPos);
36 $this->assertTrue(
false===$criticalPos,
"There was a $critical at position $criticalPos:\n". substr($this->pageContent, $criticalPos, $criticalEnd-$criticalPos).
"\n");
39 public function testIsHtmlAndNoWarningFound()
41 assertThat($this->pageContent, startsWith(
'<!DOCTYPE html>'));
42 $this->assertCriticalStringNotfound(
'PHP Notice');
43 $this->assertCriticalStringNotfound(
'PHP Fatal error');
44 $this->assertCriticalStringNotfound(
'PHP Warning');