Update copyright date for 2020
[civicrm-core.git] / tests / phpunit / CRM / Financial / Page / AjaxBatchSummaryTest.php
CommitLineData
3a449c6d
SB
1<?php
2/*
3 +--------------------------------------------------------------------+
2fe49090 4 | CiviCRM version 5 |
3a449c6d 5 +--------------------------------------------------------------------+
f299f7db 6 | Copyright CiviCRM LLC (c) 2004-2020 |
3a449c6d
SB
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
3a449c6d 27
40c60cca
SB
28/**
29 * Test for CRM_Financial_Page_Ajax class.
acb109b7 30 * @group headless
40c60cca 31 */
3a449c6d 32class CRM_Financial_Page_AjaxBatchSummaryTest extends CiviUnitTestCase {
39b959db 33
86b25ace
SB
34 /**
35 * Test the makeBatchSummary function.
36 *
37 * We want to ensure changing the method of obtaining status and payment_instrument
38 * does not cause any regression.
39 */
40 public function testMakeBatchSummary() {
9099cab3 41 $batch = $this->callAPISuccess('Batch', 'create', ['title' => 'test', 'status_id' => 'Open', 'payment_instrument_id' => 'Cash']);
40c60cca 42
86b25ace 43 $batchID = $batch['id'];
9099cab3 44 $params = ['id' => $batchID];
86b25ace
SB
45 $makeBatchSummary = CRM_Financial_Page_AJAX::makeBatchSummary($batchID, $params);
46
47 $this->assertEquals('Open', $makeBatchSummary['status']);
48 $this->assertEquals('Cash', $makeBatchSummary['payment_instrument']);
49 }
3a449c6d 50
40c60cca 51}