예제 #1
0
 public function test_configure_environment()
 {
     $this->assertNotContains(array('Functest_Tests', 'autoload'), spl_autoload_functions());
     Functest_Tests::enable_environment();
     $this->assertContains(array('Functest_Tests', 'autoload'), spl_autoload_functions());
     Functest_Tests::disable_environment();
     $this->assertNotContains(array('Functest_Tests', 'autoload'), spl_autoload_functions());
 }
예제 #2
0
if (!is_dir($system) and is_dir(DOCROOT . $system)) {
    $system = DOCROOT . $system;
}
// Define the absolute paths for configured directories
define('APPPATH', realpath($application) . DIRECTORY_SEPARATOR);
define('MODPATH', realpath($modules) . DIRECTORY_SEPARATOR);
define('SYSPATH', realpath($system) . DIRECTORY_SEPARATOR);
// Clean up the configuration vars
unset($application, $modules, $system);
/**
 * Define the start time of the application, used for profiling.
 */
if (!defined('KOHANA_START_TIME')) {
    define('KOHANA_START_TIME', microtime(TRUE));
}
/**
 * Define the memory usage at the start of the application, used for profiling.
 */
if (!defined('KOHANA_START_MEMORY')) {
    define('KOHANA_START_MEMORY', memory_get_usage());
}
$_SERVER["PHP_APP_ENV"] = 'testing';
// Bootstrap the application
require APPPATH . 'bootstrap' . EXT;
Kohana::$environment = Kohana::TESTING;
// Disable output buffering
ob_end_flush();
// Enable the unittest module
Kohana::modules(Kohana::modules() + array('functest' => MODPATH . 'functest'));
Functest_Tests::enable_environment();
Functest_Tests::load_fixtures();