Fetch/tests/bootstrap.php

31 lines
793 B
PHP

<?php
/*
* This file is part of the Fetch library.
*
* (c) Robert Hafner <tedivm@tedivm.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
define('TESTING', true);
error_reporting(-1);
spl_autoload_register(function($class) {
if (0 === strpos($class, 'Fetch\\Test\\')) {
$file = __DIR__ . '/../tests/' . str_replace('\\', '/', $class) . '.php';
if (file_exists($file)) {
require_once $file;
return true;
}
} elseif (0 === strpos($class, 'Fetch\\')) {
$file = __DIR__ . '/../src/' . str_replace('\\', '/', $class) . '.php';
if (file_exists($file)) {
require_once $file;
return true;
}
}
});