From b5367c0aefff13903d7ca049b73735ec39988384 Mon Sep 17 00:00:00 2001 From: Ashley Kitson Date: Tue, 23 Sep 2014 17:06:29 +0100 Subject: [PATCH] fix tests breaking if GMP not installed - will skip properly --- README.md | 4 +++- .../Type/Number/Complex/GMPComplexTypeFactoryTest.php | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 466f839..8fbcad1 100644 --- a/README.md +++ b/README.md @@ -357,4 +357,6 @@ V2.0.0 Add GMP support V2.0.1 Additional gmp type checking -V2.0.2 update Zend dependencies \ No newline at end of file +V2.0.2 update Zend dependencies + +V2.03 fix tests breaking if GMP not installed - will skip properly diff --git a/test/src/chippyash/Type/Number/Complex/GMPComplexTypeFactoryTest.php b/test/src/chippyash/Type/Number/Complex/GMPComplexTypeFactoryTest.php index c0e3c61..102cec8 100644 --- a/test/src/chippyash/Type/Number/Complex/GMPComplexTypeFactoryTest.php +++ b/test/src/chippyash/Type/Number/Complex/GMPComplexTypeFactoryTest.php @@ -69,6 +69,7 @@ public function testCreateWithUnsupportedParamTypesThrowsException() /** * @dataProvider correctParamCombinations + * */ public function testCreateWithCorrectParamTypesReturnsComplexType($r, $i) { @@ -77,8 +78,15 @@ public function testCreateWithCorrectParamTypesReturnsComplexType($r, $i) } + /** + * For some reason phpunit ignores the requires annotation at the class level + * - it seems to process data providers first + */ public function correctParamCombinations() { + if (!extension_loaded('gmp')) { + return [[2,2]]; + } return [ //numeric int [2,2],