Skip to content
Snippets Groups Projects
Commit cf2b493c authored by Alex Arnaud's avatar Alex Arnaud
Browse files

rel#21388 - fix test failures

parent a427a948
Branches
Tags
4 merge requests!715Master,!706Master,!705Hotline master,!704Hotline#21388 sql patch checksums
......@@ -22,8 +22,14 @@
abstract class MigrateControllerTestCase extends AbstractControllerTestCase {
public function setUp() {
parent::setUp();
Storm_Model_Loader::defaultToVolatile();
$this->fixture('Class_CosmoVar', ['id' => 'patch_level', 'valeur' => 10]);
}
public function tearDown() {
Storm_Model_Loader::defaultToDb();
parent::tearDown();
}
}
......@@ -45,7 +51,7 @@ class MigrateControllerPhpDisplayTest extends MigrateControllerTestCase{
/** @test */
public function migrationPatchShouldBe10() {
$this->assertXPathContentContains('//h3', 'Niveau de patch : 10 / 14',
$this->assertXPathContentContains('//h3', 'Niveau de patch : 10 / 15',
$this->_response->getBody());
}
......
......@@ -67,7 +67,10 @@ class MigrationFixture {
->willDo(function() {throw new CustomException('database error' , '666');})
->whenCalled('execute')
->with('update working;')
->answers(true);
->answers(true)
->whenCalled('query')
->with("SHOW TABLES LIKE 'patch_hash'")
->answers(1);
Zend_Registry::set('sql', $mock_sql);
Class_Systeme_Include::setInstance($_mock_system_include);
......@@ -122,7 +125,10 @@ class MigrationFixture {
$mock_sql = Storm_Test_ObjectWrapper::mock();
$mock_sql->whenCalled('execute')
->with('update working;')
->answers(true);
->answers(true)
->whenCalled('query')
->with("SHOW TABLES LIKE 'patch_hash'")
->answers(1);
Zend_Registry::set('sql', $mock_sql);
}
......@@ -155,7 +161,9 @@ class MigrationFixture {
$mock_sql->whenCalled('execute')
->with("CREATE FUNCTION clean_spaces(str VARCHAR(255)) RETURNS VARCHAR(255) DETERMINISTIC BEGIN while instr(str, ' ') > 0 do set str := replace(str, ' ', ' '); end while; return trim(str); END")
->answers(true)
->whenCalled('execute')
->whenCalled('query')
->with("SHOW TABLES LIKE 'patch_hash'")
->answers(1)
->beStrict();
Zend_Registry::set('sql', $mock_sql);
......
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