Permalink
Browse files

Re-Adding phpunit includes

  • Loading branch information...
BRMatt committed Dec 4, 2010
1 parent 9b41a24 commit c0dab90ae5cfeb79b09c295832357402bf241d04
Showing with 15 additions and 1 deletion.
  1. +14 −0 classes/kohana/unittest/tests.php
  2. +1 −1 init.php
@@ -39,6 +39,20 @@ static function autoload($class)
*/
static public function configure_environment($do_whitelist = TRUE, $do_blacklist = TRUE)
{
+ // During a webui request we need to manually load PHPUnit
+ if( ! class_exists('PHPUnit_Util_Filter', FALSE) AND ! function_exists('phpunit_autoload'))
+ {
+ try
+ {
+ include_once 'PHPUnit/Autoload.php';
+ }
+ catch (ErrorException $e)
+ {
+ include_once 'PHPUnit/Framework.php';
+ }
+
+ }
+
if (Kohana::$is_cli)
{
restore_exception_handler();
View
@@ -1,7 +1,7 @@
<?php
// If we're on the CLI then PHPUnit will already be loaded
-if (class_exists('PHPUnit_Util_Filter', FALSE))
+if (class_exists('PHPUnit_Util_Filter', FALSE) OR function_exists('phpunit_autoload'))
{
Unittest_Tests::configure_environment();

0 comments on commit c0dab90

Please sign in to comment.