Browse Source

phpunit config

master
Alexander Yakovlev 1 year ago
parent
commit
50e0544fc7
Signed by: oreolek GPG Key ID: 1CDC4B7820C93BD3
2 changed files with 20 additions and 4 deletions
  1. +14
    -0
      phpunit.xml
  2. +6
    -4
      run.php

+ 14
- 0
phpunit.xml View File

@@ -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>

+ 6
- 4
run.php View File

@@ -33,14 +33,16 @@ $parsers = 'all';
if (PHP_SAPI !== 'cli') {
ob_start();
echo '<!DOCTYPE html><html><body><code><pre>';
$parsers = $_GET['parsers'] ?? 'all';
$parsers = explode(',', $parsers);
if (isset($_GET) && isset($_GET['parsers'])) {
$parsers = $_GET['parsers'];
$parsers = explode(',', $parsers);
}
} else {
if (isset($argv[1])) {
$parsers = explode(',', strtolower($argv[1]));
}
}
if ($parsers === 'all' || in_array('all', $parsers)) {
if ($parsers === 'all') {
$parsers = [
'urq',
'anivisual',
@@ -63,7 +65,7 @@ if ($parsers === 'all' || in_array('all', $parsers)) {

function check($classname, $command) {
global $parsers;
if (in_array($command, $parsers)) {
if (is_array($parsers) && in_array($command, $parsers)) {
$cname = 'Source\\'.$classname;
(new $cname())->check();
}