From a85a667fbccc6606e49118c6aee6d3b0d65b200d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 19 Mar 2014 10:50:12 +1300 Subject: [PATCH] CRM-14355 test to check existing behaviour of alternate syntaxes ---------------------------------------- * CRM-14355: make api treat limit = 0 as an unlimited request http://issues.civicrm.org/jira/browse/CRM-14355 --- tests/phpunit/api/v3/SyntaxConformanceTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index 8de7961999..7ccd35ae60 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -560,6 +560,23 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { $result = $this->callAPISuccess($entityName, 'get', $case[0]); $this->assertEquals($case[1], $result['count'], $case[2]); $this->assertEquals($case[1], count($result['values'])); + + //non preferred / legacy syntax + if(isset($case[0]['options']['limit'])) { + $result = $this->callAPISuccess($entityName, 'get', array('rowCount' => $case[0]['options']['limit'])); + $this->assertEquals($case[1], $result['count'], $case[2]); + $this->assertEquals($case[1], count($result['values'])); + + //non preferred / legacy syntax + $result = $this->callAPISuccess($entityName, 'get', array('option_limit' => $case[0]['options']['limit'])); + $this->assertEquals($case[1], $result['count'], $case[2]); + $this->assertEquals($case[1], count($result['values'])); + + //non preferred / legacy syntax + $result = $this->callAPISuccess($entityName, 'get', array('option.limit' => $case[0]['options']['limit'])); + $this->assertEquals($case[1], $result['count'], $case[2]); + $this->assertEquals($case[1], count($result['values'])); + } } } -- 2.25.1