Add effective end and start date, extend unit test
[civicrm-core.git] / tests / phpunit / CRM / Utils / RestTest.php
1 <?php
2
3 /**
4 * Class CRM_Utils_RestTest
5 * @group headless
6 */
7 class CRM_Utils_RestTest extends CiviUnitTestCase {
8
9 public function testProcessMultiple() {
10 $_SERVER['REQUEST_METHOD'] = 'POST';
11 $input = [
12 'cow' => [
13 'contact',
14 'create',
15 [
16 'contact_type' => 'Individual',
17 'first_name' => 'Cow',
18 ],
19 ],
20 'sheep' => [
21 'contact',
22 'create',
23 [
24 'contact_type' => 'Individual',
25 'first_name' => 'Sheep',
26 ],
27 ],
28 ];
29 $_REQUEST['json'] = json_encode($input);
30 $output = CRM_Utils_REST::processMultiple();
31 $this->assertGreaterThan(0, $output['cow']['id']);
32 $this->assertGreaterThan($output['cow']['id'], $output['sheep']['id']);
33 }
34
35 }