Skip to content

Commit 78def79

Browse files
Added warning message if people are trying to run tests without having installed dependencies
1 parent c55a775 commit 78def79

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

‎tests/HelpersTest.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@
44

55
use BarnabyWalters\Helpers\Helpers as H;
66

7+
// Load files
78
$vendorPath = realpath(dirname(__DIR__) . '/vendor/autoload.php');
8-
99
if (file_exists($vendorPath))
1010
{
11+
// If the vendor dir exists (the user is in a testing environment) load the autoloader
1112
ob_start();
1213
require $vendorPath;
1314
ob_end_clean();
1415
}
1516
else
1617
{
17-
require realpath(dirname(__DIR__) . '/BarnabyWalters/Helpers.php');
18+
die('Cannot run tests as you haven’t installed the required dependencies');
1819
}
1920

2021
/**
21-
* A test suite for app\helpers
22-
*
23-
* Contains tests for all my helper functions
24-
*
25-
* @author Barnaby Walters http://waterpigs.co.uk
26-
* @autor app\helpers\tests
22+
* A test suite for barnabywalters/helpers
23+
*
24+
* Contains tests for all my helper functions
25+
*
26+
* @author Barnaby Walters http://waterpigs.co.uk
27+
* @autor app\helpers\tests
2728
* @todo Move all traces of THE TRUNCENATOR out of here and into their own package
2829
*/
2930
class HelpersTest extends \PHPUnit_Framework_TestCase

0 commit comments

Comments
 (0)