You are here

public function PMPAPIPushWebTestCase::testPmpAPIPushPushImage in Public Media Platform API Integration 7

Pushes an image to the PMP.

File

pmpapi_push/tests/pmpapi_push.test, line 121

Class

PMPAPIPushWebTestCase
Tests the functionality of the PMPAPI push module.

Code

public function testPmpAPIPushPushImage() {
  $file_entity = $this
    ->createFileEntity(array(
    'type' => 'image',
  ));
  $guid = $file_entity->pmpapi_guid;
  sleep(self::SLEEP_TIME);
  $pmp = pmpapi_fetch($guid);
  $this
    ->assertTrue(empty($pmp->errors['query']), 'Pushed image to PMP.');
  file_delete($file_entity);
  sleep(self::SLEEP_TIME);
  $pmp = pmpapi_fetch($guid);
  $this
    ->assertTrue(!empty($pmp->errors['query']), 'Image deleted from PMP.');
}