public function PMPAPIPushWebTestCase::testPmpAPIPushPushNode in Public Media Platform API Integration 7
Pushes a node to the PMP.
File
- pmpapi_push/
tests/ pmpapi_push.test, line 100
Class
- PMPAPIPushWebTestCase
- Tests the functionality of the PMPAPI push module.
Code
public function testPmpAPIPushPushNode() {
$this
->createContentType();
$node = $this
->createNode();
$this
->assertTrue($node, 'Created test node.');
$guid = $node->pmpapi_guid;
sleep(self::SLEEP_TIME);
$pmp = pmpapi_fetch($guid);
$this
->assertTrue(empty($pmp->errors['query']), 'Pushed node to PMP.');
sleep(self::SLEEP_TIME);
node_delete($node->nid);
sleep(self::SLEEP_TIME);
$deleted_node = node_load($node->nid);
$this
->assertTrue(!$deleted_node, 'Node deleted from local.');
sleep(self::SLEEP_TIME);
$pmp = pmpapi_fetch($guid);
$this
->assertTrue(!empty($pmp->errors['query']), 'Node deleted from PMP.');
}