Skip to content
Snippets Groups Projects
Commit 24e4eb7e authored by Patrick Barroca's avatar Patrick Barroca :grin:
Browse files

rel #8257 : correction chargement durée en modification média d'album

parent 4ab9e25a
Branches
Tags
No related merge requests found
......@@ -31,6 +31,7 @@ class ZendAfi_Form_Album_Ressource extends ZendAfi_Form {
$form
->populate($model->toArray())
->addDurationFor($model)
->addFileFor($model)
->addPosterFor($model)
->detectMediaType($model)
......@@ -87,6 +88,11 @@ class ZendAfi_Form_Album_Ressource extends ZendAfi_Form {
}
public function addDurationFor($model) {
$this->duration->setValue($model->getDuration());
return $this;
}
/**
* @param $album Class_AlbumRessource
* @return ZendAfi_Form_Album_Ressource
......
......@@ -109,4 +109,24 @@ class Admin_AlbumControllerPharoVideosPostAddTest extends Admin_AlbumControllerP
$notice = $this->new_ressource->getAlbum()->getNotice();
$this->assertContains('00:20:00', $notice->get_subfield('464','a'));
}
}
class Admin_AlbumControllerPharoVideosEditTest extends Admin_AlbumControllerPharoVideosTestCase {
public function setUp() {
parent::setUp();
$this->fixture('Class_AlbumRessource', ['id' => 37,
'url' => 'http://www.pharocast.org',
'media_type' => 3,
'duration' => '00:20:00',
'titre' => 'Pharo cast',
'album' => Class_Album::find(777)]);
$this->dispatch('/admin/album/edit_ressource/id/37', true);
}
/** @test */
public function durationShouldBe20Minutes() {
$this->assertXPath( '//input[@type="text"][@name="duration"][@value="00:20:00"]');
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment