Example #1
0
 /**
  * @group ZF-8397
  */
 public function testIfMatchHttpHeaderIsResetEachRequest()
 {
     // Update an entry
     $etag = Etag::fromString('Etag: ABCD1234');
     $this->adapter->setResponse("HTTP/1.1 201 Created");
     $this->service->setMajorProtocolVersion(2);
     $entry = new App\Entry();
     $entry->link = array(new Extension\Link('http://www.example.com', 'edit', 'application/atom+xml'));
     $entry->setEtag($etag);
     $this->service->updateEntry($entry);
     // Get another entry without ETag set,
     // Previous value of If-Match HTTP header should not be sent
     $this->adapter->setResponse($this->httpEntrySample);
     $entry = $this->service->getEntry('http://www.example.com');
     $headers = $this->adapter->popRequest()->headers;
     $found = false;
     foreach ($headers as $header => $value) {
         if ($header == 'If-Match' && $value == $etag->getFieldValue()) {
             $found = true;
         }
     }
     $this->assertFalse($found, 'If-Match header found');
 }