diff --git a/VERSIONS_HOTLINE/119194 b/VERSIONS_HOTLINE/119194 new file mode 100644 index 0000000000000000000000000000000000000000..e258ebed5bbedc28ed89fcb839323bd579bf4b0e --- /dev/null +++ b/VERSIONS_HOTLINE/119194 @@ -0,0 +1 @@ + - ticket #119194 : Magasin de thème: Supprimer le nom des auteurs (les bibliothécaires) \ No newline at end of file diff --git a/library/templates/Intonation/Library/View/Wrapper/Article.php b/library/templates/Intonation/Library/View/Wrapper/Article.php index 4ebc7cf77b46e4d8f49a5678c38bdace93a7dc1d..21262054cf77f9543c348ed6c99daea1c2a484cd 100644 --- a/library/templates/Intonation/Library/View/Wrapper/Article.php +++ b/library/templates/Intonation/Library/View/Wrapper/Article.php @@ -28,7 +28,7 @@ class Intonation_Library_View_Wrapper_Article extends Intonation_Library_View_Wr public function getSecondaryTitle() { - return $this->_whenTitleIsNotHidden($this->_model->getAuthorName()); + return ''; } @@ -61,11 +61,6 @@ class Intonation_Library_View_Wrapper_Article extends Intonation_Library_View_Wr protected function _getMainLinkTitle() { - if ($author = $this->getSecondaryTitle()) - return $this->_('Lire l\'article %s écrit par %s', - $this->getMainTitle(), - $author); - return $this->_('Lire l\'article: %s', $this->getMainTitle()); } diff --git a/library/templates/Intonation/View/RenderArticle.php b/library/templates/Intonation/View/RenderArticle.php index 2ea11a75da10ac5620778af61efdafbd98c3666e..ebe47f81ebfd796e2b8a3b2c3e390499c3758795 100644 --- a/library/templates/Intonation/View/RenderArticle.php +++ b/library/templates/Intonation/View/RenderArticle.php @@ -31,11 +31,7 @@ class Intonation_View_RenderArticle extends ZendAfi_View_Helper_BaseHelper { ? '' : $this->_tag('h2', $article->getTitre(), - ['class' => 'card-title']) - . $this->_tag('p', - $article->getAuthorName(), - ['title' => $this->_('Auteur de l\'article "%s".', $article->getAuthorName()), - 'class' => 'card-subtitle text-muted']), + ['class' => 'card-title']), $this->_badges($wrapper), diff --git a/tests/scenarios/Templates/TemplatesArticlesTest.php b/tests/scenarios/Templates/TemplatesArticlesTest.php index 3780d40043bb0e4d310fd1298219da346af66928..726fa63f8f1dc747a9103c436e8dfeb281a8eece 100644 --- a/tests/scenarios/Templates/TemplatesArticlesTest.php +++ b/tests/scenarios/Templates/TemplatesArticlesTest.php @@ -43,9 +43,11 @@ abstract class TemplatesArticlesWidgetTestCase extends Admin_AbstractControllerT 'layout' => 'multiple_carousel']) ->assertSave(); + $this->fixture('Class_Article', ['id' => 4, 'titre' => 'Winter', + 'auteur'=> Class_Users::find(1), 'contenu' => '<p>is ...</p>']); $this->fixture('Class_Article', @@ -107,6 +109,13 @@ class TemplatesArticlesWidgetTest extends TemplatesArticlesWidgetTestCase { ->whenCalled('getArticlesByPreferences') ->answers(Class_Article::findAllBy(['id_article' => [4, 6, 7]])); + Class_Article::find(4) + ->setAuteur($this->fixture('Class_Users', + ['id'=> 1 , + 'login'=> 'Toto1234', + 'password'=>'1234', + 'nom'=> 'Toto', + 'prenom'=> 'Alfred'])); $this->dispatch('/opac/index/index/id_profil/1', true); } @@ -129,6 +138,19 @@ class TemplatesArticlesWidgetTest extends TemplatesArticlesWidgetTestCase { $this->assertXPathContentContains('//div[contains(@class, "boite news")]//div[@class="card-title"]', $title); } + + + /** + * @test + */ + public function widgetCarouselArticleShouldNotContainsAlfredToto() { + $this->assertNotXPathContentContains('//div[contains(@class, "boite news")]//div[@class="card-subtitle"]','Alfred Toto'); + } + + /** @test */ + public function widgetCarouselArticleHoverShoulNotContainAlfredToto() { + $this->assertNotXpath('//div[contains(@class, "boite news")]//a[contains(@title,"Alfred Toto")]'); + } } @@ -194,10 +216,22 @@ class TemplatesArticlesCmsListActionTest extends TemplatesArticlesWidgetTestCase class TemplatesArticlesCmsArticleViewTest extends TemplatesArticlesWidgetTestCase { public function setUp() { parent::setUp(); + Class_Article::find(7) + ->setAuteur($this->fixture('Class_Users', + ['id' => 88393, + 'login' => 'Harlock', + 'password' => 'Arc4di4 for 3v3r'])); + $this->dispatch('/opac/cms/articleview/id/7/id_profil/1'); } + /** @test */ + public function authorShouldNotBePresent() { + $this->assertNotXPathContentContains('//div', 'Harlock'); + } + + /** @test */ public function parlerVousFrançaisShouldBePresent() { $this->assertXPathContentContains('//main//div//h2[@class="card-title"]', 'Parlez-vous français ?');