Skip to content

Commit 85bb28f

Browse files
committed
Fix tests
1 parent 0ee072b commit 85bb28f

2 files changed

Lines changed: 14 additions & 22 deletions

File tree

‎tests/controller/main_controller_test.php‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,10 @@ public function test_display_redirects_when_disabled_and_closes_completed_tree()
213213
$ruleset_operator->method('is_published')->with('en')->willReturn(true);
214214
$assigned_rules = array();
215215
$template = $this->createMock(\phpbb\template\template::class);
216-
<<<<<<< HEAD
217216
$block_var_call = 0;
218217
$template->expects(self::exactly(5))
219218
->method('assign_block_vars')
220-
->willReturnCallback(function ($block, $variables) use (&$block_var_call) {
219+
->willReturnCallback(function ($block, $variables) use (&$block_var_call, &$assigned_rules) {
221220
$expected = array(
222221
array('rules', 'TITLE'),
223222
array('rules', 'TITLE'),
@@ -232,22 +231,12 @@ public function test_display_redirects_when_disabled_and_closes_completed_tree()
232231
{
233232
self::assertSame(array('S_CLOSE_LIST' => true), $variables);
234233
}
234+
if ($block === 'rules' && isset($variables['U_ANCHOR']))
235+
{
236+
$assigned_rules[] = $variables;
237+
}
235238
$block_var_call++;
236239
});
237-
=======
238-
$template->expects(self::exactly(5))->method('assign_block_vars')->withConsecutive(
239-
array('rules', self::arrayHasKey('TITLE')),
240-
array('rules', self::arrayHasKey('TITLE')),
241-
array('rules', array('S_CLOSE_LIST' => true)),
242-
array('rules', self::arrayHasKey('TITLE')),
243-
array('navlinks', self::arrayHasKey('U_VIEW_FORUM'))
244-
)->willReturnCallback(function ($block, $vars) use (&$assigned_rules) {
245-
if ($block === 'rules' && isset($vars['U_ANCHOR']))
246-
{
247-
$assigned_rules[] = $vars;
248-
}
249-
});
250-
>>>>>>> master
251240
$helper = $this->getMockBuilder(\phpbb\controller\helper::class)
252241
->disableOriginalConstructor()
253242
->getMock();

‎tests/migrations/v310_upgrade_test.php‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ public function test_language_trees_are_renumbered_independently(): void
101101
$migration = new \phpbb\boardrules\migrations\v30x\m20_unicode_language_trees(
102102
new \phpbb\config\config(array()),
103103
$this->db,
104-
$factory->get($this->db, true),
104+
$factory->get($this->new_doctrine_dbal(), true),
105105
$phpbb_root_path,
106106
$phpEx,
107-
'phpbb_'
107+
'phpbb_',
108+
self::get_core_tables()
108109
);
109110
$migration->renumber_language_trees();
110111

@@ -149,10 +150,11 @@ public function test_language_tree_renumbering_crosses_update_batch_boundary():
149150
$migration = new \phpbb\boardrules\migrations\v30x\m20_unicode_language_trees(
150151
new \phpbb\config\config(array()),
151152
$this->db,
152-
$factory->get($this->db, true),
153+
$factory->get($this->new_doctrine_dbal(), true),
153154
$phpbb_root_path,
154155
$phpEx,
155-
'phpbb_'
156+
'phpbb_',
157+
self::get_core_tables()
156158
);
157159
$migration->renumber_language_trees();
158160

@@ -176,10 +178,11 @@ public function test_table_lock_config_is_removed_only_on_revert(): void
176178
$migration = new \phpbb\boardrules\migrations\v30x\m20_unicode_language_trees(
177179
new \phpbb\config\config(array()),
178180
$this->db,
179-
$factory->get($this->db, true),
181+
$factory->get($this->new_doctrine_dbal(), true),
180182
$phpbb_root_path,
181183
$phpEx,
182-
'phpbb_'
184+
'phpbb_',
185+
self::get_core_tables()
183186
);
184187

185188
foreach ($migration->update_data() as $instruction)

0 commit comments

Comments
 (0)