Be compatible with PHPUnit installed with composer.

Doing a class_exists() check is a simple way to check for PHPUnit being
installed via an autoloader. It also keeps things compatible with
a Vendor dir installation.

Fixes #3721
Remove test case that is no longer useful.

It is impossible for the current test to ever fail in the test suite, as
PHPUnit will always be loaded.