You are here

public function FppServicesTest::testFppUpdate in Fieldable Panels Panes (FPP) 7

Tests FPP resource Update.

File

tests/fpp.services.test, line 242
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 testFppUpdate() {
  $privileged_user = $this
    ->drupalCreateUser(array(
    'administer services',
    'administer fieldable panels panes',
    'edit fieldable fieldable_panels_pane',
  ));
  $this
    ->drupalLogin($privileged_user);
  $fpp = $this
    ->createFpp();
  $fpp_update = (array) $fpp;
  $fpp_update['title'] = $this
    ->randomName();
  $this
    ->servicesPut($this->endpoint->path . '/fieldable_panels_panes/' . $fpp->fpid, $fpp_update);
  $fppAfterUpdate = fieldable_panels_panes_load($fpp->fpid);
  $this
    ->assertTrue(isset($fppAfterUpdate->fpid), 'fieldable panels pane was successfully updated', 'fppResource: Updated');
  $this
    ->assertEqual($fppAfterUpdate->title, $fpp_update['title'], 'Title is the same', 'fppResource: Update');
}