$this->getResponseTester($response)->assertResponseCookieValueSame('foo', 'bar'); $this->expectException(AssertionFailedError::class); $this->expectExceptionMessage('has cookie "bar" and has cookie "bar" with value "bar".'); $this->getResponseTester($response)->assertResponseCookieValueSame('bar', 'bar'); }