diff --git a/library/Class/AdminVar.php b/library/Class/AdminVar.php index 00e0e0a28a35f4a48a5759507400d9100f187e40..427ff531ed5b3659a9b84b11b4f45d14b7f373c5 100644 --- a/library/Class/AdminVar.php +++ b/library/Class/AdminVar.php @@ -84,9 +84,9 @@ class Class_AdminVarLoader extends Storm_Model_Loader { ? self::filterByUserRole(array_map( function($clef) { return ($var = Class_AdminVar::find($clef)) ? - $var : Class_AdminVar::set($clef, ''); + $var : Class_AdminVar::set($clef, Class_AdminVar::getValueOrDefault($clef)); }, - array_keys($this->knownVars()[$controller]))) + array_keys($this->knownVars()[$controller]))) : []; } diff --git a/tests/application/modules/admin/controllers/NewsletterControllerTest.php b/tests/application/modules/admin/controllers/NewsletterControllerTest.php index eeda907295e05d8dbea7b9c4abc5d1b5665f5572..937f1741d616e4ff360958a0c0e7c059e0f3d820 100644 --- a/tests/application/modules/admin/controllers/NewsletterControllerTest.php +++ b/tests/application/modules/admin/controllers/NewsletterControllerTest.php @@ -60,15 +60,21 @@ class Admin_NewsletterControllerConfigActionTest extends Admin_NewsletterControl /** @test */ - public function NewsletterIdProfilVarShouldBeDisplayed() { + public function newsletterIdProfilVarShouldBeDisplayed() { $this->assertXPathContentContains('//tr//td','NEWSLETTER_ID_PROFIL'); } /** @test */ - public function NewsletterUnsubscribeVarShouldBeDisplayed() { - $this->assertXPathContentContains('//tr//td','NEWSLETTER_UNSUBSCRIBE_TEXT'); + public function newsletterUnsubscribeVarShouldBeDisplayed() { + $this->assertXPathContentContains('//tr//td[1]','NEWSLETTER_UNSUBSCRIBE_TEXT'); + } + + + /** @test */ + public function newsletterUnsubscribeTextVarShouldContainsLinkToUnsubscribe() { + $this->assertXPathContentContains('//tr//td[2]','Lien pour se désinscrire de cette'); } }