KEINOS / TPL-PHP-HelloWorld

✅ Overly-super-cautious "Hello World" in PHP7 and PHP8 for fun.
Apache License 2.0
2 stars 0 forks source link

PHPUnit test returns as skipped when fail #25

Closed KEINOS closed 4 years ago

KEINOS commented 4 years ago

Sometimes PHPUnit exits with code 2.

https://github.com/KEINOS/TPL-PHP-HelloWorld/blob/da076ca4bc5dcbc1ee7f1713b3b7aa8809431c07/tests/run-tests.sh#L286-L303

    ./vendor/bin/phpunit \
        --configuration ./tests/conf/phpunit.xml \
        $option_testdox
-    return $?
+    [ $? -eq 0 ] && {
+        return 0
+    }
+    return 1
KEINOS commented 4 years ago

Oneliner.

    ./vendor/bin/phpunit \
        --configuration ./tests/conf/phpunit.xml \
        $option_testdox
-   return $?
+   [ $? -eq 0 ] && return 0 || return 1