Permalink
Browse files

Get the tests running for PEAR's Continuous Integration server.

git-svn-id: http://svn.php.net/repository/pear/packages/Net_IDNA2/trunk@321639 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 942cb0e commit 21ea1ffabaaf78bebf198cd6724b62c9cf47bb08 Daniel Convissor committed Jan 1, 2012
Showing with 20 additions and 15 deletions.
  1. +16 −11 tests/AllTests.php
  2. +2 −2 tests/Net_IDNA2Test.php
  3. +2 −2 tests/draft-josefsson-idn-test-vectors.php
View
@@ -1,32 +1,37 @@
<?php
-if (!defined('PHPUnit2_MAIN_METHOD')) {
- define('PHPUnit2_MAIN_METHOD', 'Net_IDNA2_AllTests::main');
+if (!defined('PHPUnit_MAIN_METHOD')) {
+ define('PHPUnit_MAIN_METHOD', 'Net_IDNA2_AllTests::main');
}
-require_once 'PHPUnit2/TextUI/TestRunner.php';
-
-require_once 'Net_IDNA2Test.php';
-require_once 'draft-josefsson-idn-test-vectors.php';
+if ($fp = @fopen('PHPUnit/Autoload.php', 'r', true)) {
+ require_once 'PHPUnit/Autoload.php';
+} elseif ($fp = @fopen('PHPUnit/Framework.php', 'r', true)) {
+ require_once 'PHPUnit/Framework.php';
+ require_once 'PHPUnit/TextUI/TestRunner.php';
+} else {
+ die("skip could not find PHPUnit\n");
+}
+fclose($fp);
class Net_IDNA2_AllTests
{
public static function main()
{
- PHPUnit2_TextUI_TestRunner::run(self::suite());
+ PHPUnit_TextUI_TestRunner::run(self::suite());
}
public static function suite()
{
- $suite = new PHPUnit2_Framework_TestSuite('PEAR - Net_IDNA2');
+ $suite = new PHPUnit_Framework_TestSuite('PEAR - Net_IDNA2');
- $suite->addTestSuite('Net_IDNA2Test');
- $suite->addTestSuite('draft-josefsson-idn-test-vectors');
+ $suite->addTestFile(dirname(__FILE__) . '/Net_IDNA2Test.php');
+ $suite->addTestFile(dirname(__FILE__) . '/draft-josefsson-idn-test-vectors.php');
return $suite;
}
}
-if (PHPUnit2_MAIN_METHOD == 'Net_IDNA2_AllTests::main') {
+if (PHPUnit_MAIN_METHOD == 'Net_IDNA2_AllTests::main') {
Net_IDNA2_AllTests::main();
}
View
@@ -1,8 +1,8 @@
<?php
require_once 'Net/IDNA2.php';
-require_once 'PHPUnit2/Framework/TestCase.php';
+require_once 'PHPUnit/Framework/TestCase.php';
-class Net_IDNA2Test extends PHPUnit2_Framework_TestCase
+class Net_IDNA2Test extends PHPUnit_Framework_TestCase
{
/**
* Initialise tests
@@ -1,12 +1,12 @@
<?php
require_once 'Net/IDNA2.php';
-require_once 'PHPUnit2/Framework/TestCase.php';
+require_once 'PHPUnit/Framework/TestCase.php';
// Test cases from http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html
define('IDNA_ACE_PREFIX', 'xn--');
-class IDNATest extends PHPUnit2_Framework_TestCase {
+class IDNATest extends PHPUnit_Framework_TestCase {
public function setUp() {
$this->idn = new Net_IDNA2();

0 comments on commit 21ea1ff

Please sign in to comment.