public function testRegisterAutoload() { $callback = array('cfhCompile_Loader', 'autoload'); // Check that we are not registered. $autoLoaders = spl_autoload_functions(); if (!is_array($autoLoaders)) { $autoLoaders = array(); } $this->assertFalse(in_array($callback, $autoLoaders, TRUE)); // Register cfhCompile_Loader::registerAutoload(); $autoLoaders = spl_autoload_functions(); $this->assertTrue(in_array($callback, $autoLoaders, TRUE)); // Un register cfhCompile_Loader::registerAutoload(FALSE); $autoLoaders = spl_autoload_functions(); $this->assertFalse(in_array($callback, $autoLoaders, TRUE)); }
* @copyright Copyright (c) 2007 - 2008 William Bailey <*****@*****.**>. * @license http://www.gnu.org/licenses/lgpl.html Lesser GPL * @version $Id$ */ error_reporting(E_ALL | E_STRICT); chdir(dirname(__FILE__)); require_once 'PHPUnit/Util/Filter.php'; require_once 'PHPUnit/Framework/TestSuite.php'; require_once 'PHPUnit/TextUI/TestRunner.php'; require_once 'PHPUnit/Extensions/Database/TestCase.php'; if (file_exists('cfhCompile.compiled.php')) { require_once 'cfhCompile.compiled.php'; PHPUnit_Util_Filter::addFileToWhitelist('cfhCompile.compiled.php'); } else { require_once '../library/cfhCompile/Loader.php'; cfhCompile_Loader::registerAutoload(); PHPUnit_Util_Filter::addDirectoryToWhitelist(realpath('../library/')); PHPUnit_Util_Filter::addFileToFilter(__FILE__); } /** * Main Unit Test Class. * * @category cfh * @package cfhCompile * @subpackage UnitTests * @copyright Copyright (c) 2007 - 2008 William Bailey <*****@*****.**>. */ class AllTests { public static function suite($dir = NULL) {