You are here

public function BlogapiMovabletypeEndpointTestCase::testPublishPost in Blog API 7.2

Test mt.publishPost().

File

modules/blogapi_movabletype/blogapi_movabletype.test, line 31
Endpoint tests for BlogAPI MovableType

Class

BlogapiMovabletypeEndpointTestCase
@file Endpoint tests for BlogAPI MovableType

Code

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

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

  // Test user without node view permission.
  $result = xmlrpc($this->xmlrpcUrl, array(
    'mt.publishPost' => array(
      $node->nid,
      $this->privilegedUser2->name,
      $this->privilegedUser2->pass_raw,
    ),
  ));
  $updated_node = node_load($node->nid, NULL, TRUE);
  $this
    ->assertTrue($result && $updated_node->status, 'Node was published');
}