PDepend\Report\Overview\Pyramid::setLogFile PHP Method

setLogFile() public method

Sets the output log file.
public setLogFile ( string $logFile ) : void
$logFile string The output log file.
return void
    public function setLogFile($logFile)
    {
        $this->logFile = $logFile;
    }

Usage Example

 /**
  * testCollectedAndComputedValuesInOutputSVG
  *
  * @return void
  */
 public function testCollectedAndComputedValuesInOutputSVG()
 {
     $output = self::createRunResourceURI('temp.svg');
     if (file_exists($output)) {
         unlink($output);
     }
     $log = new Pyramid();
     $log->setLogFile($output);
     $log->log($this->createCouplingAnalyzer());
     $log->log($this->createComplexityAnalyzer());
     $log->log($this->createInheritanceAnalyzer());
     $log->log($this->createNodeCountAnalyzer());
     $log->log($this->createNodeLocAnalyzer());
     $log->close();
     $this->assertFileExists($output);
     $expected = array('cyclo' => 5579, 'loc' => 35175, 'nom' => 3618, 'noc' => 384, 'nop' => 19, 'andc' => 0.31, 'ahh' => 0.12, 'calls' => 15128, 'fanout' => 8590, 'cyclo-loc' => 0.15, 'loc-nom' => 9.720000000000001, 'nom-noc' => 9.42, 'noc-nop' => 20.21, 'fanout-calls' => 0.5600000000000001, 'calls-nom' => 4.18);
     $svg = new \DOMDocument();
     $svg->load($output);
     // TODO: Replace this loop assertion
     foreach ($expected as $name => $value) {
         $elem = $svg->getElementById("pdepend.{$name}");
         $this->assertInstanceOf('\\DOMElement', $elem);
         $this->assertEquals($value, $elem->nodeValue, null, 0.01);
     }
     unlink($output);
 }