public function PMPAPIPullWebTestCase::testPmpAPIPullEmbargoedStory in Public Media Platform API Integration 7
Checks for status = 0 on pulled embargoed story.
File
- pmpapi_pull/
tests/ pmpapi_pull.test, line 128
Class
- PMPAPIPullWebTestCase
- Tests the functionality of the PMPAPI pull module.
Code
public function testPmpAPIPullEmbargoedStory() {
$this
->createContentType();
$valid = new stdClass();
$valid->from = pmpapi_convert_timestamp(strtotime('+ 100 days', time()));
$values = array(
'profile' => 'story',
'attributes' => array(
'valid' => $valid,
'title' => $this
->randomName(20),
),
);
$doc = pmpapi_send($values);
$this
->assertTrue(is_object($doc), 'Successfully pushed a story to the PMP.');
sleep(self::SLEEP_TIME);
$guid = $doc->attributes->guid;
pmpapi_pull_pull_doc($guid);
$node = node_load(1);
$this
->assertTrue(is_object($node), 'Pulled story and created node.');
$this
->assertFalse($node->status, 'Embargoed story is unpublished.');
pmpapi_remove($doc->attributes->guid);
}