From 06f945f27840b53e57795dadbc38e76f7e11ab1c Mon Sep 17 00:00:00 2001 From: Horus3 Date: Mon, 24 Feb 2014 16:42:14 +0100 Subject: init --- zend/tests/Zend/Gdata/DocsTest.php | 95 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 zend/tests/Zend/Gdata/DocsTest.php (limited to 'zend/tests/Zend/Gdata/DocsTest.php') diff --git a/zend/tests/Zend/Gdata/DocsTest.php b/zend/tests/Zend/Gdata/DocsTest.php new file mode 100755 index 0000000..682a8d1 --- /dev/null +++ b/zend/tests/Zend/Gdata/DocsTest.php @@ -0,0 +1,95 @@ +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")); + } + + +} -- cgit v1.2.3