You are here

public function BlogapiBloggerEndpointTestCase::testDeletePost in Blog API 7.2

Test blogger.deletePost().

File

modules/blogapi_blogger/blogapi_blogger.test, line 294
Endpoint tests for BlogAPI Blogger

Class

BlogapiBloggerEndpointTestCase
@file Endpoint tests for BlogAPI Blogger

Code

public function testDeletePost() {
  $type = $this
    ->drupalCreateContentType();

  // Allow to user our content type with BlogAPI
  variable_set('blogapi_node_types', array(
    $type->type,
  ));
  $node = $this
    ->drupalCreateNode(array(
    'type' => $type->type,
    'uid' => $this->privilegedUser2->uid,
  ));

  // Test user without blogAPI permission.
  $result = xmlrpc($this->xmlrpcUrl, array(
    'blogger.deletePost' => array(
      '1234567890',
      $node->nid,
      $this->privilegedUser2->name,
      $this->privilegedUser2->pass_raw,
      TRUE,
    ),
  ));
  $deleted_node = node_load($node->nid, NULL, TRUE);
  $this
    ->assertTrue($result && !$deleted_node, 'Node was deleted');
}