Add a script to check the coverage of the tests and the configuration for phpunit.

This commit is contained in:
Teromene 2016-08-01 22:11:11 +02:00
parent d097a872fe
commit 206d29d52d
2 changed files with 46 additions and 0 deletions

34
tests/coverageTest.php Normal file
View File

@ -0,0 +1,34 @@
<?php
require_once 'lib/RssBridge.php';
Bridge::setDir('bridges/');
Format::setDir('formats/');
Cache::setDir('caches/');
class coverageTest extends PHPUnit_Framework_TestCase {
public function testCoverage() {
$covered = true;
foreach(Bridge::listBridges() as $bridgeName) {
$testPath = 'tests/' . $bridgeName . 'Test.php';
if(!file_exists($testPath)) {
echo 'Bridge ' . $bridgeName . ' does not have a test !' . "\n";
$covered = false;
}
}
if($covered) {
$this->success('Everything is covered !');
} else {
$this->fail('Some bridges are missing tests !');
}
}
}
?>

12
tests/phpunit.xml Normal file
View File

@ -0,0 +1,12 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.5/phpunit.xsd"
colors="true"
bootstrap="../lib/Tests.php"
processIsolation="true"
timeoutForSmallTests="1"
timeoutForMediumTests="1"
timeoutForLargeTests="6" >
</phpunit>