mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-13 21:13:26 +00:00
Fix #1006, story thumbnails are displayed correctly
This commit is contained in:
@@ -66,7 +66,7 @@ return call_user_func(
|
||||
$response->setLastModified($file->get_modification_date());
|
||||
}
|
||||
|
||||
if ($file->getDataboxSubdef()->get_class() == \databox_subdef::CLASS_THUMBNAIL) {
|
||||
if (false === $record->is_grouping() && $file->getDataboxSubdef()->get_class() == \databox_subdef::CLASS_THUMBNAIL) {
|
||||
// default expiration is 5 days
|
||||
$expiration = 60 * 60 * 24 * 5;
|
||||
|
||||
|
@@ -2,9 +2,7 @@
|
||||
|
||||
require_once __DIR__ . '/../../../PhraseanetWebTestCaseAuthenticatedAbstract.class.inc';
|
||||
|
||||
use Silex\WebTestCase;
|
||||
use Symfony\Component\HttpKernel\Client;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\File\UploadedFile;
|
||||
|
||||
class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
@@ -110,6 +108,29 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->get_a_permalink();
|
||||
}
|
||||
|
||||
public function testGetAStorythumbnail()
|
||||
{
|
||||
$story = \record_adapter::createStory(self::$collection);
|
||||
|
||||
$media = $this->getMockBuilder('MediaVorus\Media\Media')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$symfoFile = new UploadedFile(__DIR__ . '/../../../testfiles/cestlafete.jpg', 'cestlafete.jpg');
|
||||
|
||||
$media->expects($this->any())
|
||||
->method('getFile')
|
||||
->will($this->returnValue($symfoFile));
|
||||
|
||||
$story->substitute_subdef('thumbnail', $media);
|
||||
|
||||
$this->client->request('GET', '/datafiles/' . $story->get_sbas_id() . '/' . $story->get_record_id() . '/preview/');
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
|
||||
protected function get_a_permalink()
|
||||
{
|
||||
$token = static::$records['record_1']->get_preview()->get_permalink()->get_token();
|
||||
|
Reference in New Issue
Block a user