Example #1
0
 public function run($bla)
 {
     $test = $bla && $bla === 'test' || $bla === 'ha' ? 'haha' : 'test';
     if ($test && $test > 0) {
         echo '';
     } elseif (!$test) {
         echo '';
     } else {
         echo '';
     }
     $test = true;
     while ($test) {
         $test = false;
     }
     for ($i = 0; $i; $i++) {
         echo '';
     }
     switch ($test) {
         default:
             echo '';
             break;
     }
     if (empty($test)) {
         echo '';
     }
     if (!is_null($test)) {
         echo '';
     }
     if (fixture($test)) {
         echo '';
     }
     if ($test === 'hi') {
         echo '';
     }
 }
 /**
  * @test
  */
 public function itShouldAnalyseAllFiles()
 {
     $files = [fixture('MyClass.php')];
     $nodes = [$this->node];
     $parseRes = $this->parser->parse(Argument::type('string'));
     $this->parser->parse(Argument::type('string'))->shouldBeCalled()->willReturn($nodes);
     $this->nodeTraverser->traverse($nodes)->shouldBeCalled();
     $this->analyser->analyse($files);
 }
Example #3
0
 /**
  * @test
  */
 public function itShouldAnalyseTargetFileAndOutputXml()
 {
     $path = fixture('MyClass.php');
     $output = tempnam(sys_get_temp_dir(), 'xml');
     $this->argumentManager->get('format')->shouldBeCalled()->willReturn('xml');
     $this->argumentManager->get('path')->shouldBeCalled()->willReturn($path);
     $this->argumentManager->get('output')->shouldBeCalled()->willReturn($output);
     $this->climate->out('Written 1 assumption(s) to file ' . $output)->shouldBeCalled();
     $this->cli->handle(['phpa', $path]);
     $this->assertTrue(is_file($output));
 }