mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13803] Added get_max_id() tests
PHPBB3-13803
This commit is contained in:
parent
ae6ad754a4
commit
7a8ac4bb71
2 changed files with 7 additions and 1 deletions
|
@ -51,7 +51,7 @@ abstract class row_based_plugin extends base
|
||||||
{
|
{
|
||||||
$columns = $this->get_columns();
|
$columns = $this->get_columns();
|
||||||
|
|
||||||
$sql = 'SELECT MAX(' . $columns['id'] . ' AS max_id FROM ' . $this->get_table_name();
|
$sql = 'SELECT MAX(' . $columns['id'] . ') AS max_id FROM ' . $this->get_table_name();
|
||||||
$result = $this->db->sql_query($sql);
|
$result = $this->db->sql_query($sql);
|
||||||
$max_id = (int) $this->db->sql_fetchfield('max_id');
|
$max_id = (int) $this->db->sql_fetchfield('max_id');
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
|
@ -32,6 +32,12 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_get_max_id()
|
||||||
|
{
|
||||||
|
$reparser = $this->get_reparser();
|
||||||
|
$this->assertEquals(1000, $reparser->get_max_id());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dataProvider getReparseTests
|
* @dataProvider getReparseTests
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue