You are here

public function ResponseTest::testIsNotModifiedIfModifiedSinceAndEtagWithoutLastModified 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::testIsNotModifiedIfModifiedSinceAndEtagWithoutLastModified()

File

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

Class

ResponseTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testIsNotModifiedIfModifiedSinceAndEtagWithoutLastModified() {
  $modified = 'Sun, 25 Aug 2013 18:33:31 GMT';
  $etag = 'randomly_generated_etag';
  $request = new Request();
  $request->headers
    ->set('if_none_match', sprintf('%s, %s', $etag, 'etagThree'));
  $request->headers
    ->set('If-Modified-Since', $modified);
  $response = new Response();
  $response->headers
    ->set('ETag', $etag);
  $this
    ->assertTrue($response
    ->isNotModified($request));
  $response->headers
    ->set('ETag', 'non-existent-etag');
  $this
    ->assertFalse($response
    ->isNotModified($request));
}