From 2a4cb97566ecf004d4e5d32619ec633425622ba4 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Thu, 27 Jul 2017 08:00:59 +1000 Subject: [PATCH] CRM-20972 Attempt to handle new type of Execption thrown in php7.1 when function call has too few variables --- .../phpunit/api/v3/SyntaxConformanceTest.php | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 7c040f616b..59be3fc924 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -680,12 +680,20 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { /** * @dataProvider entities - * @expectedException PHPUnit_Framework_Error * @param $Entity */ public function testWithoutParam_get($Entity) { // should get php complaining that a param is missing - $result = civicrm_api($Entity, 'Get'); + try { + $result = civicrm_api($Entity, 'Get'); + $this->fail('Expected an exception. No exception was thrown.'); + } + catch (ArgumentCountError $e) { + /* ok */ + } + catch (PHPUnit_Framework_Error $e) { + /* ok */ + } } /** @@ -1387,12 +1395,20 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { /** * @dataProvider entities - * @expectedException PHPUnit_Framework_Error * @param $Entity */ public function testWithoutParam_delete($Entity) { // should delete php complaining that a param is missing - $result = civicrm_api($Entity, 'Delete'); + try { + $result = civicrm_api($Entity, 'Delete'); + $this->fail('Expected an exception. No exception was thrown.'); + } + catch (ArgumentCountError $e) { + /* ok */ + } + catch (PHPUnit_Framework_Error $e) { + /* ok */ + } } /** -- 2.25.1