From 910f24f9976c940c4b4d99dd5fc81edd49d2bc7f Mon Sep 17 00:00:00 2001 From: Jon Goldberg Date: Fri, 22 Feb 2019 16:53:38 -0500 Subject: [PATCH] test for reporting#10 --- .../CRM/Report/Form/Contribute/DetailTest.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php index f3fbefcda9..af89473113 100644 --- a/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php +++ b/tests/phpunit/CRM/Report/Form/Contribute/DetailTest.php @@ -96,6 +96,24 @@ class CRM_Report_Form_Contribute_DetailTest extends CiviReportTestCase { $this->assertCsvArraysEqual($expectedOutputCsvArray, $reportCsvArray); } + /** + * Test that the pagination widget is present. + * + * @dataProvider dataProvider + * @param $reportClass + * @param $inputParams + * @throws \Exception + */ + public function testPager($reportClass, $inputParams) { + $contactID = $this->individualCreate(); + for ($i = 1; $i <= 51; $i++) { + $this->contributionCreate(['contact_id' => $contactID, 'total_amount' => 50 + $i]); + } + $reportObj = $this->getReportObject($reportClass, $inputParams); + $pager = $reportObj->getTemplate()->_tpl_vars['pager']; + $this->assertEquals($pager->_response['numPages'], 2, "Pages in Pager"); + } + /** * @return array */ -- 2.25.1