<?php /** * Please note this file shouldn't be exposed on a live server, * there is no filtering of $_POST!!!! */ error_reporting(0); $cli_mode = setup_cli($argv); // Determines if running in cli mode /** * Configure your paths here: */ define('MAIN_PATH', realpath(dirname(__FILE__)) . '/'); define('SIMPLETEST', MAIN_PATH . 'tests/simpletest/'); // Directory of simpletest define('ROOT', MAIN_PATH); // Directory of codeigniter index.php define('TESTS_DIR', MAIN_PATH . 'tests/'); // Directory of your tests. define('APP_DIR', MAIN_PATH . 'bonfire/application/'); // CodeIgniter Application directory //do not use autorun as it output ugly report upon no test run require_once SIMPLETEST . 'unit_tester.php'; require_once SIMPLETEST . 'mock_objects.php'; require_once SIMPLETEST . 'collector.php'; require_once SIMPLETEST . 'web_tester.php'; require_once SIMPLETEST . 'extensions/my_reporter.php'; $test_suite = new TestSuite(); $test_suite->_label = 'Bonfire Test Suite'; class CodeIgniterUnitTestCase extends UnitTestCase {
if (strpos($folder, 'Test') or strpos($folder, '_test')) { $files[] = $start_folder . '/' . $folder; } } } } } return $files; } //-------------------------------------------------------------------- // END UTILITY FUNCTIONS //-------------------------------------------------------------------- // Make sure we have plenty of time to run the tests. error_reporting(E_ALL ^ E_NOTICE); // Are we running in cli mode? $is_cli = setup_cli($argv); if ($is_cli) { // Setup our allowed short/long options $short_opts = ''; $short_opts .= 'a'; // Include the applications folder tests only. Not Bonfire core. $short_opts .= 'b'; // Include Bonfire's core tests only, not the app-specific ones. $short_opts .= 'f:'; // Restrict to a single file $short_opts .= 'd:'; // Restrict to a single folder $long_opts = array('app_only', 'bf_only', 'file:', 'dir:'); $cli_opts = getopt($short_opts, $long_opts); // If we are on an app_only or bf_only run, // then add the folders to the ignored folders