From 34496b9c4899f72f423d4b8283075e7639875d68 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 29 Mar 2019 10:39:26 +1300 Subject: [PATCH] Add unit test for https://github.com/civicrm/civicrm-core/pull/13158 --- tests/phpunit/api/v3/ReportTemplateTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/phpunit/api/v3/ReportTemplateTest.php b/tests/phpunit/api/v3/ReportTemplateTest.php index d328da7b12..c9e212e0a8 100644 --- a/tests/phpunit/api/v3/ReportTemplateTest.php +++ b/tests/phpunit/api/v3/ReportTemplateTest.php @@ -1089,6 +1089,22 @@ class api_v3_ReportTemplateTest extends CiviUnitTestCase { )); } + /** + * Test contact subtype filter on grant report. + */ + public function testGrantReportSeparatedFilter() { + $contactID = $this->individualCreate(['contact_sub_type' => ['Student', 'Parent']]); + $contactID2 = $this->individualCreate(); + $this->callAPISuccess('Grant', 'create', ['contact_id' => $contactID, 'status_id' => 1, 'grant_type_id' => 1, 'amount_total' => 1]); + $this->callAPISuccess('Grant', 'create', ['contact_id' => $contactID2, 'status_id' => 1, 'grant_type_id' => 1, 'amount_total' => 1]); + $rows = $this->callAPISuccess('report_template', 'getrows', [ + 'report_id' => 'grant/detail', + 'contact_sub_type_op' => 'in', + 'contact_sub_type_value' => ['Student'], + ]); + $this->assertEquals(1, $rows['count']); + } + /** * Test PCP report to ensure total donors and total committed is accurate. */ -- 2.25.1