14 use PHPUnit\Framework\Constraint\Constraint;
20 private $expectedValue;
22 public function __construct(
string $headerName,
string $expectedValue)
24 $this->headerName = $headerName;
25 $this->expectedValue = $expectedValue;
33 return sprintf(
'has header "%s" with value "%s"', $this->headerName, $this->expectedValue);
41 protected function matches($response): bool
43 return $this->expectedValue === $response->headers->get($this->headerName,
null);
53 return 'the Response '.$this->toString();