From 44b9d0560b18c47aadab4494c7c3e93ff21a244d Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Mar 2012 14:06:59 +0100 Subject: [PATCH] MINOR Backported bootstrap.php changes from master and cstom TeamCity configuration (required to run tests through phpunit binary) --- tests/bootstrap.php | 61 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 53 insertions(+), 8 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index be9aef024..e4e631958 100755 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,12 +1,25 @@ setSession($session); + + $this->pushCurrent(); + + $this->request = new SS_HTTPRequest( + (isset($_SERVER['X-HTTP-Method-Override'])) ? $_SERVER['X-HTTP-Method-Override'] : $_SERVER['REQUEST_METHOD'], + '/' + ); + + $this->response = new SS_HTTPResponse(); + + $this->init(); + } } -$_SERVER['REQUEST_URI'] = BASE_URL . '/dev'; +global $_ALL_CLASSES; +$_ALL_CLASSES['parents']['FakeController'] = array_merge($_ALL_CLASSES['parents']['Controller'], array('Controller' => 'Controller')); +$controller = new FakeController(); + +// Connect to database +global $databaseConfig; + +require_once(getcwd()."/sapphire/core/model/DB.php"); +DB::connect($databaseConfig); + +// Get test manifest ManifestBuilder::load_test_manifest(); \ No newline at end of file