1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/13740] Fix test stubs

PHPBB3-13740
This commit is contained in:
Mate Bartus
2015-07-08 13:17:42 +02:00
parent 612eead5a9
commit 1c01252b5d
3 changed files with 14 additions and 25 deletions

View File

@@ -28,10 +28,6 @@ class phpbb_installer_database_helper_test extends phpbb_test_case
$filesystem = new \phpbb\filesystem\filesystem();
$phpbb_root_path = '';
$this->database_helper = new \phpbb\install\helper\database($filesystem, $phpbb_root_path);
// I used oracle because it tolerates the shortest table prefixes
// so it's the simplest to write test cases for
$this->dbms_mock = $this->getMock('\phpbb\db\driver\oracle');
}
/**
@@ -65,7 +61,7 @@ class phpbb_installer_database_helper_test extends phpbb_test_case
*/
public function test_validate_table_prefix($expected, $test_string)
{
$this->assertEquals($expected, $this->database_helper->validate_table_prefix($this->dbms_mock, $test_string));
$this->assertEquals($expected, $this->database_helper->validate_table_prefix('oracle', $test_string));
}
// Data provider for the remove comments function
@@ -100,17 +96,9 @@ class phpbb_installer_database_helper_test extends phpbb_test_case
'abcd "efgh"' . "\n" . 'qwerty',
'SELECT * FROM table',
),
'abcd "efgh"
qwerty;
SELECT * FROM table',
';',
),
array(
array(
'SELECT * FROM table1',
'SELECT * FROM table2 WHERE i_am="king"',
),
'SELECT * FROM table1; SELECT * FROM table2 WHERE i_am="king"',
'abcd "efgh"' . "\n" .
'qwerty' . "\n" .
'SELECT * FROM table',
';',
),
);