public function FppServicesTest::testFppCreate in Fieldable Panels Panes (FPP) 7
Tests FPP resource Create.
File
- tests/
fpp.services.test, line 199 - Tests the services resource Fieldable Panels Pane methods and actions.
Class
- FppServicesTest
- Test the services resource Fieldable Panels Pane methods and actions.
Code
public function testFppCreate() {
$privileged_user = $this
->drupalCreateUser(array(
'administer services',
'administer fieldable panels panes',
'create fieldable fieldable_panels_pane',
));
$this
->drupalLogin($privileged_user);
$fpp = array(
'title' => 'Tests',
'bundle' => 'fieldable_panels_pane',
);
$response = $this
->servicesPost($this->endpoint->path . '/fieldable_panels_panes', $fpp);
$body = $response['body'];
$this
->assertTrue(isset($body['fpid']), 'fieldable panels pane was successfully created', 'fppResource: Create');
$new_fpp = fieldable_panels_panes_load($body['fpid']);
$this
->assertEqual($new_fpp->title, $fpp['title'], 'Title was the same', 'fppResource: Create');
}