PHP: Test for PHPUnit

I needed to short-circuit a logging routine because every time I ran PHPUnit it would put a bunch of bogus entries in my logs. Here is a simple test to see if we're inside of a PHPUnit test.

function in_unit_test() {
    $ret = class_exists('PHPUnit_Framework_TestCase');

    return $ret;
}


Note: Replies will be formatted with PHP Markdown Extra syntax.

Name: Email (Not Required):
 
Logged IP: 3.93.74.25
To prevent spam please submit by clicking the kitten: