Fix tests

This commit is contained in:
Nicolas Le Goff
2014-12-02 18:09:33 +01:00
parent 2ed2e5ec10
commit 34ef9079ef
2 changed files with 1 additions and 3 deletions

View File

@@ -26,7 +26,7 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
$this->assertNotFoundResponse(self::$DI['client']->getResponse()); $this->assertNotFoundResponse(self::$DI['client']->getResponse());
} }
public function testEtag() public function testLastModified()
{ {
$tmp = tempnam(sys_get_temp_dir(), 'testEtag'); $tmp = tempnam(sys_get_temp_dir(), 'testEtag');
copy(__DIR__ . '/../../../../files/cestlafete.jpg', $tmp); copy(__DIR__ . '/../../../../files/cestlafete.jpg', $tmp);
@@ -43,7 +43,6 @@ class OverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
/* @var $response \Symfony\Component\HttpFoundation\Response */ /* @var $response \Symfony\Component\HttpFoundation\Response */
$this->assertTrue($response->isOk()); $this->assertTrue($response->isOk());
$this->assertNotNull($response->getEtag());
$this->assertInstanceOf('DateTime', $response->getLastModified()); $this->assertInstanceOf('DateTime', $response->getLastModified());
$this->assertEquals(0, $response->getMaxAge()); $this->assertEquals(0, $response->getMaxAge());
$this->assertEquals(0, $response->getTtl()); $this->assertEquals(0, $response->getTtl());

View File

@@ -37,7 +37,6 @@ class ServeFileResponseFactoryTest extends \PhraseanetWebTestCaseAbstract
$response = $this->factory->deliverFile(__DIR__ . '/../../../../files/cestlafete.jpg', 'hello', 'attachment', 'application/json', 23456); $response = $this->factory->deliverFile(__DIR__ . '/../../../../files/cestlafete.jpg', 'hello', 'attachment', 'application/json', 23456);
$this->assertEquals(23456, $response->getMaxAge()); $this->assertEquals(23456, $response->getMaxAge());
$this->assertTrue($response->headers->getCacheControlDirective('private'));
} }
public function testDeliverFileWithFilename() public function testDeliverFileWithFilename()