예제 #1
0
 public function testGetRawResponseBody()
 {
     try {
         $rowData = array();
         $entry = $this->gdata->insertRow($rowData, $this->sprKey);
         $this->fail('Expecting ZendGData\\App\\HttpException');
     } catch (\ZendGData\App\HttpException $hExc) {
         $message = $hExc->getMessage();
         $this->assertEquals('Expected response code 200, got 400', $message);
         $body = $hExc->getRawResponseBody();
         $this->assertNotNull($body);
         $this->assertNotEquals(stripos($body, 'Blank rows cannot be written; use delete instead.'), false);
     }
 }
 public function testCustomElementsCollected()
 {
     $rowData = array();
     $rowData['a1'] = 'new';
     $rowData['b1'] = 'row';
     $rowData['c1'] = 'data';
     $rowData['d1'] = 'here';
     $entry = $this->gdata->insertRow($rowData, $this->sprKey);
     $this->assertEquals(4, count($entry->custom));
     $this->assertEquals(4, count($entry->customByName));
     $this->assertEquals('new', $entry->custom[0]->getText());
     $this->assertEquals('row', $entry->custom[1]->getText());
     $this->assertEquals('data', $entry->custom[2]->getText());
     $this->assertEquals('here', $entry->custom[3]->getText());
     $this->assertEquals('new', $entry->customByName['a1']->getText());
     $this->assertEquals('row', $entry->customByName['b1']->getText());
     $this->assertEquals('data', $entry->customByName['c1']->getText());
     $this->assertEquals('here', $entry->customByName['d1']->getText());
     $ssTest = new Spreadsheets($entry->getService()->getHttpClient());
     $ssTest->delete($entry);
 }