[HttpKernel] fixed tests that can sporadically fail

This commit is contained in:
Fabien Potencier 2011-12-07 21:39:45 +01:00
parent b7fd5198ec
commit 237c36a167

View File

@ -601,7 +601,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->request('GET', '/');
$this->assertHttpKernelIsCalled();
$this->assertEquals(200, $this->response->getStatusCode());
$this->assertEquals(0, $this->response->headers->get('Age'));
$this->assertTrue($this->response->headers->get('Age') <= 1);
$this->assertNotNull($this->response->headers->get('X-Content-Digest'));
$this->assertTraceContains('stale');
$this->assertTraceNotContains('fresh');
@ -640,7 +640,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertEquals(200, $this->response->getStatusCode());
$this->assertNotNull($this->response->headers->get('Last-Modified'));
$this->assertNotNull($this->response->headers->get('X-Content-Digest'));
$this->assertEquals(0, $this->response->headers->get('Age'));
$this->assertTrue($this->response->headers->get('Age') <= 1);
$this->assertEquals('Hello World', $this->response->getContent());
$this->assertTraceContains('stale');
$this->assertTraceContains('valid');
@ -676,7 +676,7 @@ class HttpCacheTest extends HttpCacheTestCase
$this->assertEquals(200, $this->response->getStatusCode());
$this->assertNotNull($this->response->headers->get('ETag'));
$this->assertNotNull($this->response->headers->get('X-Content-Digest'));
$this->assertEquals(0, $this->response->headers->get('Age'));
$this->assertTrue($this->response->headers->get('Age') <= 1);
$this->assertEquals('Hello World', $this->response->getContent());
$this->assertTraceContains('stale');
$this->assertTraceContains('valid');