From ab24c42d1a93d55482fc0f385a9eaa30274cbfcc Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sat, 22 Dec 2018 08:54:11 +1100 Subject: [PATCH] Add in unit test to support changes in UF API in PR 13343 --- .../phpunit/api/v3/SyntaxConformanceTest.php | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index ee607119d2..e16d1e7e7d 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -929,6 +929,44 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { } } + /** + * Test getlist works + * @dataProvider entities_get + * @param $Entity + */ + public function testGetList($Entity) { + if (in_array($Entity, $this->toBeImplemented['get']) + || in_array($Entity, $this->toBeSkipped_getByID()) + ) { + return; + } + if (in_array($Entity, ['ActivityType', 'SurveyRespondant'])) { + $this->markTestSkipped(); + } + $this->callAPISuccess($Entity, 'getlist', ['label_field' => 'id']); + } + + + /** + * Test getlist works when entity is lowercase + * @dataProvider entities_get + * @param $Entity + */ + public function testGetListLowerCaseEntity($Entity) { + if (in_array($Entity, $this->toBeImplemented['get']) + || in_array($Entity, $this->toBeSkipped_getByID()) + ) { + return; + } + if (in_array($Entity, ['ActivityType', 'SurveyRespondant'])) { + $this->markTestSkipped(); + } + if ($Entity == 'UFGroup') { + $Entity = 'ufgroup'; + } + $this->callAPISuccess($Entity, 'getlist', ['label_field' => 'id']); + } + /** * Create two entities and make sure we can fetch them individually by ID. * -- 2.25.1