Skip to content
Snippets Groups Projects
Commit bd65c3ee authored by llaffont's avatar llaffont
Browse files

Album audio record: fix display file size when empty

parent e7f51670
Branches
Tags
1 merge request!2Audio Record Index
......@@ -22,9 +22,14 @@
class ZendAfi_View_Helper_AlbumRessourceInfos extends Zend_View_Helper_HtmlElement {
public function albumRessourceInfos($ressource) {
$file_info = new Class_File_Info($ressource->getOriginalPath());
$description = $file_info->fileExtension();
if ($size = $file_info->fileSize())
$description .=', '.$this->view->memoryFormat($size);
return $ressource->findTitle()
.'<br/>'
.'['.$file_info->fileExtension().', '.$this->view->memoryFormat($file_info->fileSize()).']';
.'['.$description.']';
}
}
......
......@@ -25,7 +25,11 @@ class ZendAfi_View_Helper_FileInfos extends Zend_View_Helper_Abstract {
*/
public function fileInfos($path) {
$file_info = new Class_File_Info($path);
return $file_info->fileNameWithExtension().', '.$this->view->memoryFormat($file_info->fileSize());
$description = $file_info->fileNameWithExtension();
if ($size = $file_info->fileSize())
$description .=', '.$this->view->memoryFormat($size);
return $description;
}
}
?>
\ No newline at end of file
......@@ -252,9 +252,9 @@ class RechercheControllerAlbumAudioRecordViewRessourcesNumeriquesTest extends Re
/** @test **/
public function liForUnknownShouldBeFileNameUnknownMp3ZeroBite() {
public function liForUnknownShouldBeFileNameUnknownMp3() {
$this->assertXPathContentContains('//ol//li', 'Unknown');
$this->assertXPathContentContains('//ol//li', '[mp3, 0 o]');
$this->assertXPathContentContains('//ol//li', '[mp3]');
}
......
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