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

dev #13060 refactoring done while searching for failing tests

parent 9d4bba58
Branches
Tags
5 merge requests!258Dev/13872 Orphee Allow Hold Available Items,!180Master,!169Dev#13060 Amelioration Formulaire Inscription,!167Master,!152Dev#13060 Amelioration Formulaire Inscription
......@@ -95,6 +95,8 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe
public function setUp() {
Storm_Model_Abstract::unsetLoaders();
$this->_registry_sql = Zend_Registry::get('sql');
if (!is_object($this->_registry_sql))
$this->fail('SQL in registry should be an object');
Class_ScriptLoader::resetInstance();
$this->_initMockProfil();
......@@ -156,16 +158,6 @@ abstract class AbstractControllerTestCase extends Zend_Test_PHPUnit_ControllerTe
}
public function getSqlMock() {
$mock_sql = $this->getMockBuilder('Class_Systeme_Sql')
->disableOriginalConstructor()
->getMock();
Zend_Registry::set('sql', $mock_sql);
return $mock_sql;
}
public function postDispatch($url, $data) {
$this->getRequest()
->setMethod('POST')
......
......@@ -31,7 +31,7 @@ class Admin_AccueilControllerFormationsTestWithDefaultSettings extends Admin_Abs
->updateModuleConfigAccueil(1, ['type_module' => 'FORMATIONS_WIDGET',
'division' => 1,
'id_module' => 1,
'selected_formations' => ''])
'preferences' => ['selected_formations' => '']])
->beCurrentProfil();
$this->dispatch('admin/accueil/formations-widget?config=accueil&id_profil=1&id_module=1&type_module=FORMATIONS_WIDGET', true);
......
......@@ -19,16 +19,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class MatiereTest extends PHPUnit_Framework_TestCase {
public function setUp() {
$this->mock_sql = $this
->getMockBuilder('Class_Systeme_Sql')
->disableOriginalConstructor()
->getMock();
Zend_Registry::set('sql', $this->mock_sql);
}
class MatiereTest extends Storm_Test_ModelTestCase {
/** @test */
function sqlQueriesShouldBeEscaped() {
Storm_Test_ObjectWrapper::onLoaderOfModel('Class_Matiere')
......
......@@ -118,6 +118,8 @@ abstract class ViewHelperTestCase extends PHPUnit_Framework_TestCase {
->setValeur(null);
Storm_Cache::setDefaultZendCache(null);
Zend_Registry::get('translate')->setLocale('fr');
}
......
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