1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 23:25:30 +02:00

[ticket/13803] Added get_max_id() tests

PHPBB3-13803
This commit is contained in:
JoshyPHP 2015-05-09 19:06:48 +02:00
parent ae6ad754a4
commit 7a8ac4bb71
2 changed files with 7 additions and 1 deletions

View File

@ -51,7 +51,7 @@ abstract class row_based_plugin extends base
{
$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);
$max_id = (int) $this->db->sql_fetchfield('max_id');
$this->db->sql_freeresult($result);

View File

@ -32,6 +32,12 @@ abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_t
parent::setUp();
}
public function test_get_max_id()
{
$reparser = $this->get_reparser();
$this->assertEquals(1000, $reparser->get_max_id());
}
/**
* @dataProvider getReparseTests
*/