Skip to content
Snippets Groups Projects
Commit 4e89245f authored by Patrick Barroca's avatar Patrick Barroca
Browse files

rel #18297: fix locale setting in tests bootstrap

parent 6a2d66d3
Branches
Tags
3 merge requests!896Master,!806Dev#18297 rgaa search result and viewnotice,!805Dev#18297 rgaa search result and viewnotice
......@@ -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'];
......
......@@ -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/'));
......
......@@ -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'));
}
}
......
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