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