forked from silverstripe/solr-php-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpunit.bootstrap.php
36 lines (29 loc) · 906 Bytes
/
phpunit.bootstrap.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
require 'vendor/autoload.php';
// set error reporting high
error_reporting(E_ALL | E_STRICT);
// make sure we see them
ini_set('display_errors', 'On');
// make sure current directory and class directories are on include path
// this is necessary for auto load to work
set_include_path(
// distribution files (where the zip / tgz is unpacked)
dirname(dirname(__FILE__)) . PATH_SEPARATOR .
// test file directory "tests"
dirname(__FILE__) . PATH_SEPARATOR .
// current include path (for PHPUnit, etc.)
get_include_path()
);
// set up an autoload for Zend / Pear style class loading
spl_autoload_register(
function($class)
{
$path = str_replace("_", DIRECTORY_SEPARATOR, $class) . ".php";
if (file_exists($path)) {
require $path;
}
if (file_exists("tests/$path")) {
require "tests/$path";
}
}
);