mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/16345] Small improvements
PHPBB3-16346
This commit is contained in:
@@ -62,7 +62,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
|
||||
public function test_auto_increment()
|
||||
{
|
||||
$sql = 'DELETE FROM prefix_table_name';
|
||||
$result = $this->db->sql_query($sql);
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
$row1 = array_merge(self::get_default_values(), array(
|
||||
'c_uint' => 1,
|
||||
@@ -72,11 +72,11 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
|
||||
));
|
||||
|
||||
$sql = 'INSERT INTO prefix_table_name ' . $this->db->sql_build_array('INSERT', $row1);
|
||||
$result = $this->db->sql_query($sql);
|
||||
$this->db->sql_query($sql);
|
||||
$id1 = $this->db->sql_nextid();
|
||||
|
||||
$sql = 'INSERT INTO prefix_table_name ' . $this->db->sql_build_array('INSERT', $row2);
|
||||
$result = $this->db->sql_query($sql);
|
||||
$this->db->sql_query($sql);
|
||||
$id2 = $this->db->sql_nextid();
|
||||
|
||||
$this->assertGreaterThan($id1, $id2, 'Auto increment should increase the id value');
|
||||
|
@@ -20,7 +20,7 @@ class phpbb_dbal_connect_test extends phpbb_database_test_case
|
||||
|
||||
public function test_failing_connect()
|
||||
{
|
||||
global $phpbb_root_path, $phpEx, $phpbb_filesystem;
|
||||
global $phpbb_filesystem;
|
||||
|
||||
$phpbb_filesystem = new phpbb\filesystem\filesystem();
|
||||
|
||||
|
@@ -182,10 +182,10 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
|
||||
|
||||
// empty table
|
||||
$sql = 'DELETE FROM prefix_table_name';
|
||||
$result = $this->db->sql_query($sql);
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
$sql = 'INSERT INTO prefix_table_name ' . $this->db->sql_build_array('INSERT', $row_insert);
|
||||
$result = $this->db->sql_query($sql);
|
||||
$this->db->sql_query($sql);
|
||||
|
||||
$sql = "SELECT *
|
||||
FROM prefix_table_name";
|
||||
|
@@ -44,7 +44,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
|
||||
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator.xml');
|
||||
}
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
@@ -13,7 +13,7 @@
|
||||
|
||||
class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
|
||||
{
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->config = new \phpbb\config\config(array());
|
||||
|
||||
|
@@ -18,9 +18,9 @@ class phpbb_dbal_migrator_tool_config_text_test extends phpbb_database_test_case
|
||||
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_config_text.xml');
|
||||
}
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setup();
|
||||
parent::setUp();
|
||||
|
||||
$this->db = $this->new_dbal();
|
||||
$this->config_text = new \phpbb\config\db_text($this->db, 'phpbb_config_text');
|
||||
|
@@ -21,12 +21,12 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
|
||||
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_module.xml');
|
||||
}
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
// Need global $db, $user for delete_module function in acp_modules
|
||||
global $phpbb_root_path, $phpEx, $skip_add_log, $db, $user, $phpbb_log;
|
||||
|
||||
parent::setup();
|
||||
parent::setUp();
|
||||
|
||||
// Disable the logs
|
||||
$skip_add_log = true;
|
||||
@@ -48,7 +48,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
|
||||
$phpbb_extension_manager = new phpbb_mock_extension_manager($phpbb_root_path);
|
||||
$module_manager = new \phpbb\module\module_manager($cache, $this->db, $phpbb_extension_manager, MODULES_TABLE, $phpbb_root_path, $phpEx);
|
||||
|
||||
$this->tool = new \phpbb\db\migration\tool\module($this->db, $this->cache, $this->user, $module_manager, $phpbb_root_path, $phpEx, 'phpbb_modules');
|
||||
$this->tool = new \phpbb\db\migration\tool\module($this->db, $this->user, $module_manager, 'phpbb_modules');
|
||||
}
|
||||
|
||||
public function exists_data_acp()
|
||||
|
@@ -30,12 +30,12 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
|
||||
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_permission.xml');
|
||||
}
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
// Global $db and $cache are needed in acp/auth.php constructor
|
||||
global $phpbb_root_path, $phpEx, $db, $cache;
|
||||
|
||||
parent::setup();
|
||||
parent::setUp();
|
||||
|
||||
$db = $this->db = $this->new_dbal();
|
||||
$cache = $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
|
||||
|
@@ -26,7 +26,7 @@ class phpbb_dbal_schema_test extends phpbb_database_test_case
|
||||
$sql = "INSERT INTO phpbb_config
|
||||
(config_name, config_value)
|
||||
VALUES ('name', '$value')";
|
||||
$result = $db->sql_query($sql);
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = "SELECT config_value
|
||||
FROM phpbb_config
|
||||
|
@@ -16,7 +16,7 @@ class phpbb_dbal_sql_affected_rows_test extends phpbb_database_test_case
|
||||
/** @var \phpbb\db\driver\driver_interface */
|
||||
protected $db;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->db = $this->new_dbal();
|
||||
|
@@ -16,7 +16,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
|
||||
protected $db;
|
||||
protected $buffer;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
|
Reference in New Issue
Block a user