Merge pull request #12280 from eileenmcnaughton/line_endings
[civicrm-core.git] / tests / phpunit / CRM / Utils / RestTest.php
CommitLineData
0fe377f6 1<?php
aba1cd8b
EM
2
3/**
4 * Class CRM_Utils_RestTest
acb109b7 5 * @group headless
aba1cd8b 6 */
0fe377f6 7class CRM_Utils_RestTest extends CiviUnitTestCase {
0fe377f6 8
00be9182 9 public function setUp() {
0fe377f6
CW
10 parent::setUp();
11 }
12
00be9182 13 public function testProcessMultiple() {
0fe377f6
CW
14 $_SERVER['REQUEST_METHOD'] = 'POST';
15 $input = array(
16 'cow' => array(
17 'contact',
18 'create',
19 array(
20 'contact_type' => 'Individual',
21 'first_name' => 'Cow',
22 ),
23 ),
24 'sheep' => array(
25 'contact',
26 'create',
27 array(
28 'contact_type' => 'Individual',
29 'first_name' => 'Sheep',
30 ),
31 ),
32 );
33 $_REQUEST['json'] = json_encode($input);
34 $output = CRM_Utils_REST::processMultiple();
35 $this->assertGreaterThan(0, $output['cow']['id']);
36 $this->assertGreaterThan($output['cow']['id'], $output['sheep']['id']);
37 }
38
39}