[constant-trickery] Also skip tests when required extension is missing.

This commit is contained in:
Andreas Fischer 2013-01-12 03:07:41 +01:00
parent 306f0711ed
commit 3c75fa1ad4
2 changed files with 10 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();
}