Example #1
0
 public function testUpdatePostWithMinimumInformations()
 {
     // Given
     $blogId = 'blog id';
     $username = '******';
     $password = '******';
     $xmlRpcClientResponse = 1;
     $excerpt = $publish = $slug = $categoryId = null;
     $id = 1;
     $title = 'Title';
     $content = 'Lorem Ipsum';
     $publish = 1;
     $this->xmlRpcClient->expects($this->once())->method('call')->with('metaWeblog.editPost', array($id, $username, $password, array('title' => $title, 'mt_excerpt' => $excerpt, 'description' => $content, 'wp_slug' => $slug, 'categories' => array(array('categoryId' => (string) $categoryId)), 'post_type' => 'post'), $publish))->will($this->returnValue($xmlRpcClientResponse));
     $client = new Client(null, $username, $password, $blogId, $this->xmlRpcClient);
     // When
     $result = $client->updatePost($id, $title, $excerpt, $content, $publish, $slug, $categoryId);
     // Then
     $this->assertTrue($result == $xmlRpcClientResponse);
 }