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