From 8571aa0bad188c9103fa3ab0c21a6c438d5eea52 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 24 May 2012 03:00:06 +0200 Subject: [PATCH] [feature/phpunit] Use SPL autoloading instead of manual loading. --- tests/Math/BigIntegerTest.php | 2 -- tests/bootstrap.php | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/Math/BigIntegerTest.php b/tests/Math/BigIntegerTest.php index ad0badbc..2559fa51 100644 --- a/tests/Math/BigIntegerTest.php +++ b/tests/Math/BigIntegerTest.php @@ -5,8 +5,6 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ -require('Math/BigInteger.php'); - class BigIntegerTest extends PHPUnit_Framework_TestCase { public function getInstance($x = 0, $base = 10) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 35c9427f..eb7136b8 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -11,3 +11,12 @@ set_include_path(implode(PATH_SEPARATOR, array( dirname(__FILE__) . '/../phpseclib/', get_include_path(), ))); + +function phpseclib_autoload($class) +{ + $file = str_replace('_', '/', $class) . '.php'; + + require $file; +} + +spl_autoload_register('phpseclib_autoload');