diff options
author | Mate Bartus <mate.bartus@gmail.com> | 2015-09-19 19:56:01 +0200 |
---|---|---|
committer | Mate Bartus <mate.bartus@gmail.com> | 2015-09-19 20:28:39 +0200 |
commit | 635b5999b915c982616153f31f8dbc61f996be08 (patch) | |
tree | 57b6814315f1e2ecd05bd6a481197e1ab13c6673 | |
parent | eab8a12fb8356391cb01bae909494ca828a8a6bc (diff) | |
download | forums-635b5999b915c982616153f31f8dbc61f996be08.tar forums-635b5999b915c982616153f31f8dbc61f996be08.tar.gz forums-635b5999b915c982616153f31f8dbc61f996be08.tar.bz2 forums-635b5999b915c982616153f31f8dbc61f996be08.tar.xz forums-635b5999b915c982616153f31f8dbc61f996be08.zip |
[ticket/14178] Fix installer's database helper test
PHPBB3-14178
-rw-r--r-- | tests/installer/database_helper_test.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/installer/database_helper_test.php b/tests/installer/database_helper_test.php index d2ebe76ad5..ed355884f6 100644 --- a/tests/installer/database_helper_test.php +++ b/tests/installer/database_helper_test.php @@ -56,7 +56,23 @@ 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('sqlite3', $test_string)); + $db_helper_mock = $this->getMockBuilder('\phpbb\install\helper\database') + ->setMethods(array('get_available_dbms')) + ->disableOriginalConstructor() + ->getMock(); + + $db_helper_mock->method('get_available_dbms') + ->willReturn(array('sqlite3' => array( + 'LABEL' => 'SQLite3', + 'SCHEMA' => 'sqlite', + 'MODULE' => 'sqlite3', + 'DELIM' => ';', + 'DRIVER' => 'phpbb\db\driver\sqlite3', + 'AVAILABLE' => true, + '2.0.x' => false, + ))); + + $this->assertEquals($expected, $db_helper_mock->validate_table_prefix('sqlite3', $test_string)); } // Data provider for the remove comments function |