From 3c75fa1ad4f041755807d7f90d16af39ce123a58 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 12 Jan 2013 03:07:41 +0100 Subject: [PATCH] [constant-trickery] Also skip tests when required extension is missing. --- tests/Math/BigInteger/BCMathTest.php | 5 +++++ tests/Math/BigInteger/GMPTest.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/tests/Math/BigInteger/BCMathTest.php b/tests/Math/BigInteger/BCMathTest.php index 7d953b9e..6440550b 100644 --- a/tests/Math/BigInteger/BCMathTest.php +++ b/tests/Math/BigInteger/BCMathTest.php @@ -9,6 +9,11 @@ class Math_BigInteger_BCMathTest extends Math_BigInteger_TestCase { static public function setUpBeforeClass() { + if (!extension_loaded('bcmath')) + { + self::markTestSkipped('BCMath extension is not available.'); + } + self::ensureModeConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_BCMATH); parent::setUpBeforeClass(); } diff --git a/tests/Math/BigInteger/GMPTest.php b/tests/Math/BigInteger/GMPTest.php index 2aea998b..c8895271 100644 --- a/tests/Math/BigInteger/GMPTest.php +++ b/tests/Math/BigInteger/GMPTest.php @@ -9,6 +9,11 @@ class Math_BigInteger_GMPTest extends Math_BigInteger_TestCase { static public function setUpBeforeClass() { + if (!extension_loaded('gmp')) + { + self::markTestSkipped('GNU Multiple Precision (GMP) extension is not available.'); + } + self::ensureModeConstant('MATH_BIGINTEGER_MODE', MATH_BIGINTEGER_MODE_GMP); parent::setUpBeforeClass(); }