Skip to content
Snippets Groups Projects
Commit d9589f71 authored by Matthias Meusburger's avatar Matthias Meusburger
Browse files

hotline#22305: Respect linebreaks in librarians records reviews.

parent a7713677
Branches
Tags
2 merge requests!896Master,!826Hotline#22305 add linebreaks in reviews
- hotline#22305: Respect des sauts de ligne dans les avis notice des bibliothécaires.
......@@ -124,7 +124,7 @@ class ZendAfi_View_Helper_Avis extends ZendAfi_View_Helper_BaseHelper {
$url_avis = $this->_getUrlAvis($avis);
$format_text_avis = $avis->getAbonOuBib() ?
['text_avis' => $avis->getAvis(), 'lire_la_suite' => false] :
['text_avis' => nl2br($avis->getAvis()), 'lire_la_suite' => false] :
$this->_formatTextAvis($this->view->escape($avis->getAvis()));
$text_avis = $format_text_avis['text_avis'];
......
......@@ -134,6 +134,41 @@ class ViewHelperAvisTestWithAvisNotice extends ViewHelperTestCase {
}
class ViewHelperAvisTestAsBib extends ViewHelperTestCase {
public function setUp() {
parent::setUp();
Class_Profil::getCurrentProfil()->setSkin('original');
$tintin = new Class_Users();
$tintin
->setId(26)
->setPseudo('Tintin');
$orphan_avis = new Class_AvisNotice();
$orphan_avis
->setId(67)
->setEntete("Bof")
->setAvis("Pas\nterrible")
->setNote(2.5)
->setDateAvis('2010-01-02 10:00:00')
->setUser($tintin)
->setStatut(0)
->setAbonOuBib(1)
->setNotices(array());
$helper = new ZendAfi_View_Helper_Avis();
$helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->html = $helper->avis($orphan_avis);
}
public function testBrInAvis() {
$this->assertTrue(strpos($this->html, "Pas<br />\nterrible") !== false, $this->html);
}
}
class ViewHelperAvisTestWithoutAvisNoticeAndModeration extends ViewHelperTestCase {
public function setUp() {
parent::setUp();
......
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