adapter = new Test_Zend_Gdata_MockHttpClient(); $this->client = new Zend_Gdata_HttpClient(); $this->client->setAdapter($this->adapter); $this->gdata = new Zend_Gdata_Docs($this->client); } public function testCreateFolder() { $this->adapter->setResponse(array('HTTP/1.1 200 OK\r\n\r\n')); $this->gdata->createFolder("Test Folder"); $request = $this->adapter->popRequest(); // Check to make sure the correct URI is in use $this->assertEquals( "docs.google.com", $request->uri->getHost()); $this->assertEquals( "/feeds/documents/private/full", $request->uri->getPath()); // Check to make sure that this is a folder $this->assertNotEquals( false, strpos($request->body, "assertNotEquals(false, strpos($request->body, "Test Folder")); } public function testCreateSubfolder() { $subfolderName = "MySubfolder"; $this->adapter->setResponse(array('HTTP/1.1 200 OK\r\n\r\n')); $this->gdata->createFolder("Test Folder", $subfolderName); $request = $this->adapter->popRequest(); // Check to make sure the correct URI is in use $this->assertEquals( "docs.google.com", $request->uri->getHost()); $this->assertEquals( "/feeds/folders/private/full/" . $subfolderName, $request->uri->getPath()); // Check to make sure that this is a folder $this->assertNotEquals( false, strpos($request->body, "assertNotEquals(false, strpos($request->body, "Test Folder")); } }