public function testIfMatchHttpHeaderSetOnManualPost() { $etag = Etag::fromString('Etag: ABCD1234'); $this->adapter->setResponse("HTTP/1.1 201 Created"); $this->service->setMajorProtocolVersion(2); $entry = $this->service->newEntry(); $entry->setEtag($etag); $entry->setService($this->service); $this->service->post($entry, '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->assertTrue($found, 'If-Match header not found or incorrect'); }