From b83ca1024648ecb308af51a7a5d06dccc6f3d781 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 12 Jan 2013 02:57:21 +0100 Subject: [PATCH] [constant-trickery] Add extra test cases for BCMath and GMP. --- tests/Math/BigInteger/BCMathTest.php | 15 +++++++++++++++ tests/Math/BigInteger/BigIntegerTest.php | 11 ----------- tests/Math/BigInteger/GMPTest.php | 15 +++++++++++++++ tests/Math/BigInteger/InternalTest.php | 15 +++++++++++++++ tests/Math/BigInteger/TestCase.php | 2 ++ 5 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 tests/Math/BigInteger/BCMathTest.php delete mode 100644 tests/Math/BigInteger/BigIntegerTest.php create mode 100644 tests/Math/BigInteger/GMPTest.php create mode 100644 tests/Math/BigInteger/InternalTest.php diff --git a/tests/Math/BigInteger/BCMathTest.php b/tests/Math/BigInteger/BCMathTest.php new file mode 100644 index 00000000..7d953b9e --- /dev/null +++ b/tests/Math/BigInteger/BCMathTest.php @@ -0,0 +1,15 @@ + + * @copyright MMXIII Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +class Math_BigInteger_BCMathTest extends Math_BigInteger_TestCase +{ + static public function setUpBeforeClass() + { + self::ensureModeConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_BCMATH); + parent::setUpBeforeClass(); + } +} diff --git a/tests/Math/BigInteger/BigIntegerTest.php b/tests/Math/BigInteger/BigIntegerTest.php deleted file mode 100644 index e13fd22d..00000000 --- a/tests/Math/BigInteger/BigIntegerTest.php +++ /dev/null @@ -1,11 +0,0 @@ - - * @copyright MMXIII Andreas Fischer - * @license http://www.opensource.org/licenses/mit-license.html MIT License - */ - -class Math_BigInteger_BigIntegerTest extends Math_BigInteger_TestCase -{ - -} diff --git a/tests/Math/BigInteger/GMPTest.php b/tests/Math/BigInteger/GMPTest.php new file mode 100644 index 00000000..2aea998b --- /dev/null +++ b/tests/Math/BigInteger/GMPTest.php @@ -0,0 +1,15 @@ + + * @copyright MMXIII Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +class Math_BigInteger_GMPTest extends Math_BigInteger_TestCase +{ + static public function setUpBeforeClass() + { + self::ensureModeConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_GMP); + parent::setUpBeforeClass(); + } +} diff --git a/tests/Math/BigInteger/InternalTest.php b/tests/Math/BigInteger/InternalTest.php new file mode 100644 index 00000000..dcdc9129 --- /dev/null +++ b/tests/Math/BigInteger/InternalTest.php @@ -0,0 +1,15 @@ + + * @copyright MMXIII Andreas Fischer + * @license http://www.opensource.org/licenses/mit-license.html MIT License + */ + +class Math_BigInteger_InternalTest extends Math_BigInteger_TestCase +{ + static public function setUpBeforeClass() + { + self::ensureModeConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_INTERNAL); + parent::setUpBeforeClass(); + } +} diff --git a/tests/Math/BigInteger/TestCase.php b/tests/Math/BigInteger/TestCase.php index 50475cdf..74a92663 100644 --- a/tests/Math/BigInteger/TestCase.php +++ b/tests/Math/BigInteger/TestCase.php @@ -5,6 +5,8 @@ * @license http://www.opensource.org/licenses/mit-license.html MIT License */ +require_once 'Math/BigInteger.php'; + abstract class Math_BigInteger_TestCase extends PhpseclibTestCase { public function getInstance($x = 0, $base = 10)