Fix tests
This commit is contained in:
parent
8e97f37fe0
commit
a21a99f10f
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
tests/settings.json
|
||||
sys/db/tests/*
|
@ -230,6 +230,8 @@ function to_string($data, $method='print_r')
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
if ( ! function_exists('do_include'))
|
||||
{
|
||||
/**
|
||||
* Array_map callback to load a folder of classes at once
|
||||
*
|
||||
@ -240,6 +242,7 @@ function do_include($path)
|
||||
{
|
||||
require_once($path);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// ! Bootstrap functions
|
||||
|
@ -7,17 +7,25 @@ define('ENVIRONMENT', 'DEVELOPMENT');
|
||||
require_once('simpletest/autorun.php');
|
||||
|
||||
// Set the default paths
|
||||
define('MM_BASE_PATH', "../src/");
|
||||
define('MM_SYS_PATH', MM_BASE_PATH.'/sys/');
|
||||
define('MM_MOD_PATH', MM_BASE_PATH.'/modules/');
|
||||
define('MM_APP_PATH', MM_BASE_PATH.'/app/');
|
||||
define('MM_SYS_PATH', '../sys/');
|
||||
define('MM_MOD_PATH', '../modules/');
|
||||
define('MM_APP_PATH', '../app/');
|
||||
|
||||
// Include db autoloader
|
||||
require_once(MM_SYS_PATH . 'db/autoload.php');
|
||||
|
||||
// Include db tests
|
||||
require_once(MM_SYS_PATH . 'db/tests/index.php');
|
||||
|
||||
//Include src files
|
||||
require_once('../src/sys/common.php');
|
||||
require_once(MM_SYS_PATH . 'common.php');
|
||||
require_once(MM_SYS_PATH . 'core/traits.php');
|
||||
require_once(MM_SYS_PATH . 'core/MM.php');
|
||||
require_once(MM_SYS_PATH . 'core/miniMVC.php');
|
||||
array_map('do_include', glob(MM_SYS_PATH . 'core/*.php'));
|
||||
|
||||
//Include test files
|
||||
require_once('commonTest.php');
|
||||
require_once('MMTest.php');
|
||||
require_once('miniMVCTest.php');
|
||||
require_once('dbTest.php');
|
||||
|
||||
|
@ -12,7 +12,7 @@ class miniMVCTest extends UnitTestCase {
|
||||
|
||||
function setUp()
|
||||
{
|
||||
$this->mm = new miniMVC();
|
||||
$this->mm = miniMVC::get_instance();
|
||||
}
|
||||
|
||||
function tearDown()
|
||||
@ -32,7 +32,7 @@ class miniMVCTest extends UnitTestCase {
|
||||
// miniMVC::get_instance returns reference to latest miniMVC object
|
||||
$this->assertReference($this->mm, miniMVC::get_instance());
|
||||
|
||||
// miniMVC extends JSObject, right?
|
||||
// miniMVC extends MM, right?
|
||||
$this->assertIsA($this->mm, 'MM');
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user