Skip to content
Snippets Groups Projects
Commit 3478dc4a authored by xamgore's avatar xamgore
Browse files

Bootstrap configuration for unit-testing

parent fb99746a
Branches
Tags
No related merge requests found
<?php
class Model_Discipline_Test extends PHPUnit_Framework_TestCase {
/** @test */
function idField() {
$d = Model_Discipline::load(1);
$this->assertEquals($d->id, 1);
}
}
......@@ -121,5 +121,10 @@ if (($ob_len = ob_get_length()) !== FALSE)
}
}
// Enable the unittest module
Kohana::modules(Kohana::modules() + array('unittest' => MODPATH.'unittest'));
\ No newline at end of file
// Enable the unittest module if it is not already loaded - use the absolute path
$modules = Kohana::modules();
$unittest_path = realpath(__DIR__).DIRECTORY_SEPARATOR;
if ( ! in_array($unittest_path, $modules)) {
$modules['unittest'] = $unittest_path;
Kohana::modules($modules);
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment