mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Merge pull request #2701 from Nicofuma/ticket/12818
[ticket/12818] Deleting a log entry in MCP produces a General error * Nicofuma/ticket/12818: [ticket/12818] Use assertGreaterThanOrEqual in the tests [ticket/12818] Don't use the id for i= [ticket/12818] Add tests [ticket/12818] Fix the conditions in the call to $log->delete() in mcp_logs
This commit is contained in:
commit
248b11c4db
2 changed files with 18 additions and 2 deletions
|
@ -115,7 +115,7 @@ class mcp_logs
|
||||||
if ($deletemark && sizeof($marked))
|
if ($deletemark && sizeof($marked))
|
||||||
{
|
{
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
'forum_id' => $forum_list,
|
'forum_id' => array('IN' => $forum_list),
|
||||||
'log_id' => array('IN' => $marked),
|
'log_id' => array('IN' => $marked),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ class mcp_logs
|
||||||
$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
|
$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
|
||||||
|
|
||||||
$conditions = array(
|
$conditions = array(
|
||||||
'forum_id' => $forum_list,
|
'forum_id' => array('IN' => $forum_list),
|
||||||
'keywords' => $keywords,
|
'keywords' => $keywords,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -64,4 +64,20 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
|
||||||
$crawler = self::submit($form);
|
$crawler = self::submit($form);
|
||||||
$this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
|
$this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_delete_logs()
|
||||||
|
{
|
||||||
|
$this->login();
|
||||||
|
$crawler = self::request('GET', "mcp.php?i=mcp_logs&mode=front&sid={$this->sid}");
|
||||||
|
$this->assertGreaterThanOrEqual(1, $crawler->filter('input[type=checkbox]')->count());
|
||||||
|
|
||||||
|
$this->add_lang('mcp');
|
||||||
|
$form = $crawler->selectButton($this->lang('DELETE_ALL'))->form();
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
|
$form = $crawler->selectButton('Yes')->form();
|
||||||
|
$crawler = self::submit($form);
|
||||||
|
|
||||||
|
$this->assertCount(0, $crawler->filter('input[type=checkbox]'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue