public function __construct() { $this->TestSuite('All Tests'); $basedir = dirname(__FILE__) . '/'; foreach (self::$dirs as $dirname) { $this->addFile("{$basedir}{$dirname}/test_{$dirname}.php"); } Magnus::init('test'); DB::disconnect(); // since we auto-connect in Magnus::init() DB::$config['dbname'] = 'timber_test'; DB::connect(); }
<?php // protect staging if ($_SERVER['HTTP_HOST'] == 'staging.forrst.com') { if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) { header('WWW-Authenticate: Basic realm="HC SVNT DRACONES"'); header('HTTP/1.0 401 Unauthorized'); die; } else { if ($_SERVER['PHP_AUTH_USER'] != 'gr33k' || $_SERVER['PHP_AUTH_PW'] != '4ccent') { header('WWW-Authenticate: Basic realm="HC SVNT DRACONES"'); header('HTTP/1.0 401 Unauthorized'); die; } } } // compute our app base path $basepath = dirname(__FILE__) . '/'; define('APPPATH', str_replace('public/', '', $basepath)); unset($basepath); // bootstrap require '../../magnus/base.php'; Magnus::init(); Magnus::run();