diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..46b854a --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,14 @@ + + + + + ./Source/ + ./ + + + + + tests/ + + + diff --git a/run.php b/run.php index eb62a28..4066b69 100755 --- a/run.php +++ b/run.php @@ -33,14 +33,16 @@ $parsers = 'all'; if (PHP_SAPI !== 'cli') { ob_start(); echo '
';
-  $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();
   }