<?php/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */namespaceSymfony\Component\HttpFoundation\Tests\Test\Constraint;usePHPUnit\Framework\ExpectationFailedException;usePHPUnit\Framework\TestCase;usePHPUnit\Framework\TestFailure;useSymfony\Component\HttpFoundation\Response;useSymfony\Component\HttpFoundation\Test\Constraint\ResponseHasHeader;classResponseHasHeaderTestextendsTestCase{publicfunctiontestConstraint():void{$constraint=newResponseHasHeader('Date');$this->assertTrue($constraint->evaluate(newResponse(),'',true));$constraint=newResponseHasHeader('X-Date');$this->assertFalse($constraint->evaluate(newResponse(),'',true));try{$constraint->evaluate(newResponse());}catch(ExpectationFailedException$e){$this->assertEquals("Failed asserting that the Response has header \"X-Date\".\n",TestFailure::exceptionToString($e));return;}$this->fail();}}