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/App/HttpExceptionTest.php | 71 +++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100755 zend/tests/Zend/Gdata/App/HttpExceptionTest.php (limited to 'zend/tests/Zend/Gdata/App/HttpExceptionTest.php') diff --git a/zend/tests/Zend/Gdata/App/HttpExceptionTest.php b/zend/tests/Zend/Gdata/App/HttpExceptionTest.php new file mode 100755 index 0000000..eba19da --- /dev/null +++ b/zend/tests/Zend/Gdata/App/HttpExceptionTest.php @@ -0,0 +1,71 @@ +sprKey = constant('TESTS_ZEND_GDATA_SPREADSHEETS_SPREADSHEETKEY'); + $this->wksId = constant('TESTS_ZEND_GDATA_SPREADSHEETS_WORKSHEETID'); + $service = Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME; + $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service); + $this->gdata = new Zend_Gdata_Spreadsheets($client); + } + + public function testGetRawResponseBody() + { + try { + $rowData = array(); + $entry = $this->gdata->insertRow($rowData, $this->sprKey); + $this->fail('Expecting Zend_Gdata_App_HttpException'); + } catch (Zend_Gdata_App_HttpException $hExc) { + $this->assertThat($hExc, + $this->isInstanceOf('Zend_Gdata_App_HttpException'), + 'Expecting Zend_Gdata_App_HttpException, got ' + . get_class($hExc)); + + $message = $hExc->getMessage(); + $this->assertEquals($message, 'Expected response code 200, got 400'); + $body = $hExc->getRawResponseBody(); + $this->assertNotNull($body); + $this->assertNotEquals(stripos($body, + 'Blank rows cannot be written; use delete instead.'), false); + } + } +} -- cgit v1.2.3