I am getting a weird result when trying to create a code coverage report of my test.
I call this:
phpunit --coverage-html report tests/JSONTest.php
And get this:
PHPUnit 3.6.12 by Sebastian Bergmann.
.
Time: 0 seconds, Memory: 6.75Mb
OK (1 test, 1 assertion)
Generating code coverage report in HTML format ... done
My test looks like this:
<?php
require_once dirname(__FILE__) . "/../include/includeAllNecessaryFiles.php";
class JSONTest extends PHPUnit_Framework_TestCase {
public function testBla() {
$this->assertEquals("hallo", "hallo");
}
}
The file includeAllNecessaryFiles.php has this content:
<?php
include '/usr/share/php/PHPUnit/Framework/TestCase.php';
function something(){
}
The report lists all directories of the php-files that have been used, but doesn't list any files. It displays a 100% coverage, 0 of 0 lines have been covered.
When I throw this out:
function something(){
}
The report works properly and shows exactly how many lines the test covers.
Does anybody have an idea?
Thanks in advance!
Ben