After all, do you really test all possibilities for error?
Of course NOT.
"If I could save time in a bottle"
https://www.drupal.org/docs/8/phpunit
The testing framework PHPUnit was added to Drupal 8 in June of 2013. SimpleTest is still supported but is deprecated. Any new tests should be written using the PHPUnit based classes UnitTestCase, KernelTestBase, BrowserTestBase (web tests) or JavascriptTestBase (javascript enabled web tests using PhantomJS).
https://www.drupal.org/docs/8/phpunit/running-phpunit-tests
#!/bin/bash
#start Solr
solr stop -all
solr start
# start the built-in php web server (mysql is already started)
#php -S localhost:8888 >& /dev/null &
#../vendor/bin/drush rs 8888 >& /dev/null &
php -S localhost:8888 ../vendor/drush/drush/commands/runserver/d8-rs-router.php >& /dev/null &
# Install the site.
../vendor/bin/drush -v site-install minimal --db-url=mysql://root@localhost/search_m1 --yes --account-pass=admin
../vendor/bin/drush en --yes simpletest
# start phantomjs with gastonjs.
phantomjs --ssl-protocol=any --ignore-ssl-errors=true ../vendor/jcalderonzumba/gastonjs/src/Client/main.js 8510 1600 1080 > /tmp/pantomjs.out 2>&1 &
export SIMPLETEST_DB=mysql://root:qweszxc@localhost/search_m1
export SIMPLETEST_BASE_URL=http://localhost:8888
php core/scripts/run-tests.sh --verbose --color --non-html --concurrency 8 --php `which php` --url http://localhost:8888 --directory modules/contrib --types Simpletest | tee /tmp/tests_results.txt | grep passes; export TEST_EXIT=${PIPESTATUS[0]} ; echo $TEST_EXIT
# Check if we had fails in the run-tests.sh script
# Exit with the inverted value, because if there are no fails found, it will exit with 1 and for us that\
# is a good thing so invert it to 0. Travis has some issues with the exclamation mark in front so we have to fiddle a
# bit.
# Also make the grep case insensitive and fail on run-tests.sh regular fails as well on fatal errors.
TEST_OUTPUT=$(! egrep -i "([0-9]+ fails)|(Fatal erro)|([0-9]+ exceptions)" /tmp/test.txt > /dev/null)$?
../vendor/bin/phpunit -c core --group search_api,facets,search_api_solr,search_api_solr_multilingual --verbose | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT
# Exit the build
#echo $TEST_EXIT
echo $TEST_OUTPUT
echo $TEST_PHPUNIThttps://code.adyax.com/Contrib/conditional_fields