This repository has been archived on 2018-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
sleepy/tests/Bootstrap.php

45 lines
960 B
PHP
Raw Permalink Normal View History

2014-05-07 14:05:13 -04:00
<?php
2014-05-14 10:32:31 -04:00
// Use the same autoloader as the app for consistency
define('BASEPATH', '../');
define('SLEEPY_DIR', 'Sleepy');
define('APP_DIR', 'application');
define('APPPATH', BASEPATH . 'application/');
include BASEPATH . '/vendor/autoload.php';
require BASEPATH . SLEEPY_DIR . '/autoload.php';
2014-05-07 14:05:13 -04:00
2014-05-14 10:32:31 -04:00
/**
* Base testcase class
2014-05-07 14:05:13 -04:00
*/
class Sleepy_TestCase extends PHPUnit_Framework_TestCase {
public function setUp()
{
if ( ! isset($_SERVER['REQUEST_METHOD']))
{
$_SERVER['REQUEST_METHOD'] = 'GET';
}
}
}
// --------------------------------------------------------------------------
// ! Simple Base Mocks
// --------------------------------------------------------------------------
use Sleepy\Core\Output;
use Sleepy\Core\Config;
class MockOutput extends Output {
use Sleepy\Traits\getSet;
public function __destruct()
{
$this->_output_headers();
}
}
class MockConfig extends Config {
use Sleepy\Traits\getSet;
}
// End of tests/Bootstrap.php