示例#1
0
 public function testInMemory()
 {
     $dataSrc = new Memory();
     $collector = new Collect($dataSrc);
     $collector->startCollection();
     $sampleFilePath = __DIR__ . '/sample3.php';
     require $sampleFilePath;
     $collector->save();
     $this->expectOutputRegex('/.+/');
     // No empty
     $html = new Html($dataSrc);
     $html->output();
 }
示例#2
0
 public function testDirInMemory()
 {
     $dataSrc = new Memory();
     $collector = new Collect($dataSrc);
     $collector->startCollection();
     $dir = __DIR__ . '/sampleDir';
     require $dir . '/used.php';
     $collector->save();
     $report = new Report($dataSrc);
     $unusedFiles = $report->generateReportForDirectory($dir);
     $this->assertCount(1, $unusedFiles);
     $this->assertEquals($dir . '/decedent.php', $unusedFiles[0]);
 }