20 protected function setUp() : void
22 $this->testDb =
new TestPgDb(
"uistart");
23 $this->testDb->setupSysconfig();
25 putenv(
"SYSCONFDIR=" . $this->testDb->getFossSysConf());
26 $this->pageContent =
'';
27 $p = popen(
'php '. dirname(__DIR__).
'/ui/index.php 2>&1',
'r');
29 $line = fgets($p, 1000);
30 $this->pageContent .= $line;
35 protected function tearDown() : void
38 $this->testDb->fullDestruct();
42 private function setUpRepo()
44 $sysConf = $this->testDb->getFossSysConf();
46 $this->testInstaller->init();
47 $this->testInstaller->cpRepo();
50 private function rmRepo()
52 $this->testInstaller->rmRepo();
53 $this->testInstaller->clear();
56 private function assertCriticalStringNotfound($critical) {
57 $criticalPos = strpos($this->pageContent, $critical);
58 $criticalEnd = $criticalPos===
false ? $criticalPos : strpos($this->pageContent,
"\n", $criticalPos);
59 $this->assertTrue(
false===$criticalPos,
"There was a $critical at position $criticalPos:\n". substr($this->pageContent, $criticalPos, $criticalEnd-$criticalPos).
"\n");
62 public function testIsHtmlAndNoWarningFound()
64 assertThat($this->pageContent, startsWith(
'<!DOCTYPE html>'));
65 $this->assertCriticalStringNotfound(
'PHP Notice');
66 $this->assertCriticalStringNotfound(
'PHP Fatal error');
67 $this->assertCriticalStringNotfound(
'PHP Warning');