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

33 lines
630 B
PHP
Executable File

<?php
define('BASEPATH', realpath('../Sleepy/').'/');
define('SPATH', realpath('../').'/');
/**
* Autoloader for Sleepy
*/
\spl_autoload_register(function($item) {
$path_items = \explode('\\', \ltrim($item, '\\'));
// If the namespace is a straight mapping to the class, just load it
$simple_path = \implode('/', $path_items);
$file = SPATH . "{$simple_path}.php";
if (file_exists($file))
{
require_once($file);
return;
}
});
class Sleepy_TestCase extends PHPUnit_Framework_TestCase {
public function setUp()
{
if ( ! isset($_SERVER['REQUEST_METHOD']))
{
$_SERVER['REQUEST_METHOD'] = 'GET';
}
}
}