diff --git a/library/ZendAfi/Form/Login.php b/library/ZendAfi/Form/Login.php index b39553fc476c877b6f5b91ab13cb8ee9acc7b31c..072a9a837d35f1c9fbc831997288b14cde4bef45 100644 --- a/library/ZendAfi/Form/Login.php +++ b/library/ZendAfi/Form/Login.php @@ -24,7 +24,6 @@ class ZendAfi_Form_Login extends ZendAfi_Form { protected $_data, $_redirect_url, $_id_notice,$_service; public function init() { - xdebug_break(); parent::init(); $this->_redirect_url = $this->_data['redirect_url']; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ac7b0c611b55e203e81cbb00ec9cf84f842f53dd..6e794a0cfe82d1cf2c1bb5f4fab70c1a7953dabe 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -78,9 +78,9 @@ $cfg->amber = new Zend_Config(array('deploy' => false)); Zend_Registry::set('cfg', $cfg); $translate = Zend_Registry::get('translate'); -$translate->setLocale('fr'); $translate->addTranslation(LANG_DIR.'ro.mo', 'ro'); $translate->addTranslation(LANG_DIR.'en.mo', 'en'); +$translate->setLocale('fr'); //Initialize the router for tests that do not rely on dispatch Zend_Controller_Front::getInstance()->getRouter()->route(new Zend_Controller_Request_Http('http://localhost/')); diff --git a/tests/library/ZendAfi/Form/LoginTest.php b/tests/library/ZendAfi/Form/LoginTest.php index 48eac3ecb98aa666ff6b16c5e5cb751a964f417d..05395fde556af9955508b94e0246ab6c57f2a6ee 100644 --- a/tests/library/ZendAfi/Form/LoginTest.php +++ b/tests/library/ZendAfi/Form/LoginTest.php @@ -20,15 +20,22 @@ */ -abstract class ZendAfi_Form_LoginTestCase extends PHPUnit_Framework_TestCase { +abstract class ZendAfi_Form_LoginTestCase extends Storm_Test_ModelTestCase { protected $_form; public function setUp() { parent::setUp(); + Storm_Model_Loader::defaultToVolatile(); $this->_form = ZendAfi_Form_Login::newWithOptions(['data' => $this->_getDatas()]); } + public function tearDown() { + Storm_Model_Loader::defaultToDb(); + parent::tearDown(); + } + + protected function _getDatas() { return ['redirect_url' => '', 'id_notice' => '', @@ -48,13 +55,13 @@ abstract class ZendAfi_Form_LoginTestCase extends PHPUnit_Framework_TestCase { class ZendAfi_Form_LoginRGAAWithEmptyDatasTest extends ZendAfi_Form_LoginTestCase { /** @test */ public function usernameShouldHaveDefaultTitle() { - $this->assertEquals('Login', $this->_form->username->getAttrib('title')); + $this->assertEquals('Identifiant', $this->_form->username->getAttrib('title')); } /** @test */ public function passwordShouldHaveDefaultTitle() { - $this->assertEquals('Password', $this->_form->password->getAttrib('title')); + $this->assertEquals('Mot de passe', $this->_form->password->getAttrib('title')); } }