Example #1
0
 public function testCreateCategoryWithCorrectArguments()
 {
     // Given
     $blogId = 'blog id';
     $username = '******';
     $password = '******';
     $name = 'Category name';
     $description = 'Category description';
     $slug = $parentId = null;
     $this->xmlRpcClient->expects($this->once())->method('call')->with('wp.newCategory', array($blogId, $username, $password, array('name' => $name, 'slug' => $slug, 'category_description' => $description, 'category_parent' => $parentId)))->will($this->returnValue(true));
     $client = new Client(null, $username, $password, $blogId, $this->xmlRpcClient);
     // When
     $result = $client->createCategory($name, $slug, $description, $parentId);
     // Then
     $this->assertTrue($result);
 }