Пример #1
0
 public function testDeleteSupportsGDataV2()
 {
     // Prepare mock response
     $this->adapter->setResponse("HTTP/1.1 200 OK");
     // Make sure that we're using protocol v2
     $this->service->setMajorProtocolVersion(2);
     $this->entry->setService($this->service);
     // Set a URL for posting, so that save() will work
     $editLink = new Extension\Link('http://example.com', 'edit');
     $this->entry->setLink(array($editLink));
     // Perform a (mock) save
     $this->entry->delete();
     // Check to make sure that a v2 header was sent
     $headers = $this->adapter->popRequest()->headers;
     $found = false;
     foreach ($headers as $header => $value) {
         if ($header == 'GData-Version' && $value == 2) {
             $found = true;
         }
     }
     $this->assertTrue($found, 'GData-Version header missing or incorrect.');
 }