Skip to content
Snippets Groups Projects
Commit 79b6a1db authored by Laurent's avatar Laurent
Browse files

hotline #36324 : fix error messages display on smartphone login page

parent 733165fe
Branches
Tags
3 merge requests!1659Master,!1587Master,!1551Hotline#36324 valence pb toutapprendrearte vod 1dtouch sur profil smartphone
...@@ -79,7 +79,7 @@ class Telephone_AuthController extends AuthController { ...@@ -79,7 +79,7 @@ class Telephone_AuthController extends AuthController {
$this->_redirect($this->view->url(), array('prependBase' => false)); $this->_redirect($this->view->url(), array('prependBase' => false));
} }
$this->view->error = $this->_flashMessenger->getMessages(); $this->view->error = $this->_flashMessenger->getNotifications();
$this->view->form = $form; $this->view->form = $form;
} }
......
<?php echo $this->toolbar($this->_("Identification"));?> <?php echo $this->toolbar($this->_("Identification"));?>
<div data-role="content"> <div data-role="content">
<?php echo $this->form;?> <?php
<?php if (0 < count($this->error)) echo '<strong style="color:red">' . $this->error[0] . '</strong>';?>
</div> echo $this->form;
\ No newline at end of file
foreach($this->error as $error) {
echo '<strong style="color:red">' . $error->getMessage() . '</strong>';
}
?>
</div>
...@@ -109,6 +109,11 @@ class AuthControllerTelephoneLoginReservationTest extends AuthControllerTelephon ...@@ -109,6 +109,11 @@ class AuthControllerTelephoneLoginReservationTest extends AuthControllerTelephon
->whenCalled('hasIdentity') ->whenCalled('hasIdentity')
->answers(false); ->answers(false);
$messenger = new ZendAfi_Controller_Action_Helper_FlashMessenger();
$messenger->addNotification('An error occured');
ZendAfi_Controller_Action_Helper_FlashMessenger::reset();
$this->dispatch('auth/login-reservation/id/45324', true); $this->dispatch('auth/login-reservation/id/45324', true);
} }
...@@ -136,6 +141,11 @@ class AuthControllerTelephoneLoginReservationTest extends AuthControllerTelephon ...@@ -136,6 +141,11 @@ class AuthControllerTelephoneLoginReservationTest extends AuthControllerTelephon
$this->assertXPath('//form//input[@placeholder="password"]', $this->_response->getBody()); $this->assertXPath('//form//input[@placeholder="password"]', $this->_response->getBody());
} }
/** @test */
public function pageShouldContainsAnErrorOccured() {
$this->assertXPathContentContains('//div', 'An error occured', $this->_response->getBody());
}
} }
...@@ -162,6 +172,7 @@ class AuthControllerTelephoneLoginReservationInvalidPostTest extends AuthControl ...@@ -162,6 +172,7 @@ class AuthControllerTelephoneLoginReservationInvalidPostTest extends AuthControl
public function flashMessengerShouldContainsErrorMessage() { public function flashMessengerShouldContainsErrorMessage() {
$this->assertFlashMessengerContains('Entrez votre identifiant S.V.P.'); $this->assertFlashMessengerContains('Entrez votre identifiant S.V.P.');
} }
} }
......
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