From 3a449c6db389d33a7d3c83c5f05b8c4f9ea74492 Mon Sep 17 00:00:00 2001 From: Saurabh Batra Date: Wed, 14 Oct 2015 19:12:16 +0530 Subject: [PATCH] unitTest for getBatchSummary function to remove deprecated function getLabel --- .../Financial/Page/AjaxBatchSummaryTest.php | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php diff --git a/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php b/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php new file mode 100644 index 0000000000..dee25639fc --- /dev/null +++ b/tests/phpunit/CRM/Financial/Page/AjaxBatchSummaryTest.php @@ -0,0 +1,46 @@ +callAPISuccess('Batch', 'create', array('title' => 'test', 'status_id' => 'Open')); + $batchID = $batch['id']; + $params = array('id' => $batchID); + + $test = array( + 'status' => 'some status', // how do i extract the batch's status? + 'payment_instrument' => 'some instrument', // how do i extract the batch's payment instrument? + ); + + $makeBatchSummary = CRM_Financial_Page_AJAX::makeBatchSummary($batchID,$params); + + $this->assertEquals($test['status'], $makeBatchSummary['status']); + $this->assertEquals($test['payment_instrument'], $makeBatchSummary['payment_instrument']); + } +} \ No newline at end of file -- 2.25.1