Example #1
0
 public function testIfNoneMatchHeaderCanBeSetOnInsert()
 {
     $etagOverride = 'foo';
     $etag = Etag::fromString('Etag: ABCD1234');
     $this->service->setMajorProtocolVersion(2);
     $this->adapter->setResponse($this->httpEntrySample);
     $entry = new App\Entry();
     $entry->setEtag($etag);
     $newEntry = $this->service->insertEntry($entry, 'http://www.example.com', '\\ZendGData\\App\\Entry', array('If-None-Match' => $etagOverride));
     $headers = $this->adapter->popRequest()->headers;
     $found = false;
     foreach ($headers as $header => $value) {
         if ($header == 'If-None-Match' && $value == $etagOverride) {
             $found = true;
         }
     }
     $this->assertTrue($found, 'If-None-Match header not found or incorrect ');
 }