Exemplo n.º 1
0
 public function testHtmlReport()
 {
     $snapshot = new Snapshot(__DIR__ . '/fakeproc');
     $html = $snapshot->htmlReport(false);
     $pos = strpos($html, '<table>');
     $this->assertNotFalse($pos);
     $pos = strpos($html, '</table>');
     $this->assertNotFalse($pos);
     $numTrOpen = substr_count($html, '<tr>');
     $numTrClose = substr_count($html, '</tr>');
     $this->assertEquals($numTrOpen, $numTrClose);
     $this->assertEquals($numTrOpen, 43);
     $numTdOpen = substr_count($html, '<td class="sysinfo_key">') + substr_count($html, '<td class="sysinfo_value">') + substr_count($html, '<td class="sysinfo_unit">');
     $numTdClose = substr_count($html, '</td>');
     $this->assertEquals($numTdOpen, $numTdClose);
     $htmlSummary = $snapshot->htmlReport(true);
     $pos = strpos($htmlSummary, '<p><strong>');
     $this->assertNotFalse($pos);
     $pos = strpos($htmlSummary, '</strong></p>');
     $this->assertNotFalse($pos);
 }