Updated autoload.php for tests
This commit is contained in:
parent
9bab67f734
commit
af819913fd
1 changed files with 8 additions and 4 deletions
|
@ -1,8 +1,12 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$SourceDirectory = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'ncc';
|
$BuildDirectory = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'build';
|
||||||
|
$AutoloadPath = $BuildDirectory . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'autoload.php';
|
||||||
|
|
||||||
if(file_exists($SourceDirectory . DIRECTORY_SEPARATOR . 'autoload.php') == false)
|
if(!file_exists($BuildDirectory) || !is_dir($BuildDirectory))
|
||||||
throw new RuntimeException('The autoload file was not found in \'' . $SourceDirectory . '\'');
|
throw new RuntimeException('Build directory does not exist, to run tests you must build the project.');
|
||||||
|
|
||||||
require($SourceDirectory . DIRECTORY_SEPARATOR . 'autoload.php');
|
if(!file($AutoloadPath) || is_file($AutoloadPath))
|
||||||
|
throw new RuntimeException('Autoload file does not exist in \'' . $BuildDirectory .'\', to run tests you must build the project.');
|
||||||
|
|
||||||
|
require($AutoloadPath);
|
Loading…
Add table
Reference in a new issue