phpunit config
This commit is contained in:
parent
ef7cde242e
commit
50e0544fc7
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<phpunit colors="true">
|
||||||
|
<filter>
|
||||||
|
<whitelist processUncoveredFilesFromWhitelist="true">
|
||||||
|
<directory suffix=".php">./Source/</directory>
|
||||||
|
<directory suffix=".php">./</directory>
|
||||||
|
</whitelist>
|
||||||
|
</filter>
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="Application Test Suite">
|
||||||
|
<directory>tests/</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
</phpunit>
|
10
run.php
10
run.php
|
@ -33,14 +33,16 @@ $parsers = 'all';
|
||||||
if (PHP_SAPI !== 'cli') {
|
if (PHP_SAPI !== 'cli') {
|
||||||
ob_start();
|
ob_start();
|
||||||
echo '<!DOCTYPE html><html><body><code><pre>';
|
echo '<!DOCTYPE html><html><body><code><pre>';
|
||||||
$parsers = $_GET['parsers'] ?? 'all';
|
if (isset($_GET) && isset($_GET['parsers'])) {
|
||||||
$parsers = explode(',', $parsers);
|
$parsers = $_GET['parsers'];
|
||||||
|
$parsers = explode(',', $parsers);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isset($argv[1])) {
|
if (isset($argv[1])) {
|
||||||
$parsers = explode(',', strtolower($argv[1]));
|
$parsers = explode(',', strtolower($argv[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($parsers === 'all' || in_array('all', $parsers)) {
|
if ($parsers === 'all') {
|
||||||
$parsers = [
|
$parsers = [
|
||||||
'urq',
|
'urq',
|
||||||
'anivisual',
|
'anivisual',
|
||||||
|
@ -63,7 +65,7 @@ if ($parsers === 'all' || in_array('all', $parsers)) {
|
||||||
|
|
||||||
function check($classname, $command) {
|
function check($classname, $command) {
|
||||||
global $parsers;
|
global $parsers;
|
||||||
if (in_array($command, $parsers)) {
|
if (is_array($parsers) && in_array($command, $parsers)) {
|
||||||
$cname = 'Source\\'.$classname;
|
$cname = 'Source\\'.$classname;
|
||||||
(new $cname())->check();
|
(new $cname())->check();
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue