3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * Test for CRM_Financial_Page_Ajax class.
16 class CRM_Financial_Page_AjaxBatchSummaryTest
extends CiviUnitTestCase
{
19 * Test the makeBatchSummary function.
21 * We want to ensure changing the method of obtaining status and payment_instrument
22 * does not cause any regression.
24 * @throws \API_Exception
25 * @throws \CRM_Core_Exception
27 public function testMakeBatchSummary(): void
{
28 $batch = $this->callAPISuccess('Batch', 'create', ['title' => 'test', 'status_id' => 'Open', 'payment_instrument_id' => 'Cash']);
30 $makeBatchSummary = CRM_Financial_Page_AJAX
::makeBatchSummary($batch['id']);
32 $this->assertEquals('Open', $makeBatchSummary['status']);
33 $this->assertEquals('Cash', $makeBatchSummary['payment_instrument']);