Browse files

Added warning message if people are trying to run tests without havin…

…g installed dependencies
  • Loading branch information...
1 parent c55a775 commit 78def79898c6beb846f24f30367e67994f240d77 @barnabywalters committed Oct 16, 2012
Showing with 9 additions and 8 deletions.
  1. +9 −8 tests/HelpersTest.php
View
17 tests/HelpersTest.php
@@ -4,26 +4,27 @@
use BarnabyWalters\Helpers\Helpers as H;
+// Load files
$vendorPath = realpath(dirname(__DIR__) . '/vendor/autoload.php');
-
if (file_exists($vendorPath))
{
+ // If the vendor dir exists (the user is in a testing environment) load the autoloader
ob_start();
require $vendorPath;
ob_end_clean();
}
else
{
- require realpath(dirname(__DIR__) . '/BarnabyWalters/Helpers.php');
+ die('Cannot run tests as you haven’t installed the required dependencies');
}
/**
- * A test suite for app\helpers
- *
- * Contains tests for all my helper functions
- *
- * @author Barnaby Walters http://waterpigs.co.uk
- * @autor app\helpers\tests
+ * A test suite for barnabywalters/helpers
+ *
+ * Contains tests for all my helper functions
+ *
+ * @author Barnaby Walters http://waterpigs.co.uk
+ * @autor app\helpers\tests
* @todo Move all traces of THE TRUNCENATOR out of here and into their own package
*/
class HelpersTest extends \PHPUnit_Framework_TestCase

0 comments on commit 78def79

Please sign in to comment.