You are here

public function ResponseTest::testIsNotModifiedEtag in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/ResponseTest.php \Symfony\Component\HttpFoundation\Tests\ResponseTest::testIsNotModifiedEtag()

File

vendor/symfony/http-foundation/Tests/ResponseTest.php, line 182

Class

ResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIsNotModifiedEtag() {
  $etagOne = 'randomly_generated_etag';
  $etagTwo = 'randomly_generated_etag_2';
  $request = new Request();
  $request->headers
    ->set('if_none_match', sprintf('%s, %s, %s', $etagOne, $etagTwo, 'etagThree'));
  $response = new Response();
  $response->headers
    ->set('ETag', $etagOne);
  $this
    ->assertTrue($response
    ->isNotModified($request));
  $response->headers
    ->set('ETag', $etagTwo);
  $this
    ->assertTrue($response
    ->isNotModified($request));
  $response->headers
    ->set('ETag', '');
  $this
    ->assertFalse($response
    ->isNotModified($request));
}