Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- We are not phpunit

- HTML_BBCodeParserTest had non-standard from-cmdline runner


git-svn-id: https://svn.php.net/repository/pear/packages/HTML_BBCodeParser/trunk@239091 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
commit ccfea6728197082c3757aace4014f46a4e5eb6b8 1 parent 71682d6
@cweiske cweiske authored
Showing with 11 additions and 6 deletions.
  1. +11 −6 tests/HTML_BBCodeParserTest.php
View
17 tests/HTML_BBCodeParserTest.php
@@ -1,5 +1,12 @@
<?php
-require_once 'PHPUnit.php';
+if (!defined("PHPUnit_MAIN_METHOD")) {
+ define("PHPUnit_MAIN_METHOD", "HTML_BBCodeParserTest::main");
+}
+
+require_once "PHPUnit/Framework/TestCase.php";
+require_once "PHPUnit/Framework/TestSuite.php";
+
+chdir(dirname(__FILE__) . '/../');
require_once 'HTML/BBCodeParser.php';
class HTML_BBCodeParserTest extends PHPUnit_Framework_TestCase
@@ -235,10 +242,8 @@ function testBug11370()
}
}
-//Run tests if run from the command line
-if (realpath($_SERVER['PHP_SELF']) == __FILE__){
- $suite = new PHPUnit_TestSuite('BBCodeParser_TestCase');
- $result = PHPUnit::run($suite);
- echo $result->toString();
+// Call HTML_BBCodeParserTest::main() if this source file is executed directly.
+if (PHPUnit_MAIN_METHOD == "HTML_BBCodeParserTest::main") {
+ HTML_BBCodeParserTest::main();
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.