aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dbal
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2017-03-19 21:46:20 +0700
committerMarc Alexander <admin@m-a-styles.de>2019-05-08 21:57:00 +0200
commit42b7782927713c2ca2fb704db6217016347b586e (patch)
tree74d749f282d9087aa658eec91b73b461ffdc5b73 /tests/dbal
parentcdf3aa27df099eb440fb279ac50d1fe42e7b136c (diff)
downloadforums-42b7782927713c2ca2fb704db6217016347b586e.tar
forums-42b7782927713c2ca2fb704db6217016347b586e.tar.gz
forums-42b7782927713c2ca2fb704db6217016347b586e.tar.bz2
forums-42b7782927713c2ca2fb704db6217016347b586e.tar.xz
forums-42b7782927713c2ca2fb704db6217016347b586e.zip
[ticket/14972] Migrate from deprecated getMock() method to createMock()
PHPBB3-14972
Diffstat (limited to 'tests/dbal')
-rw-r--r--tests/dbal/db_tools_test.php16
-rw-r--r--tests/dbal/migrator_tool_module_test.php2
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index 0365463a48..818d8d8e17 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -346,10 +346,10 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
public function test_perform_schema_changes_drop_tables()
{
- $db_tools = $this->getMock('\phpbb\db\tools\tools', array(
- 'sql_table_exists',
- 'sql_table_drop',
- ), array(&$this->db));
+ $db_tools = $this->getMockBuilder('\phpbb\db\tools\tools')
+ ->setMethods(array('sql_table_exists', 'sql_table_drop'))
+ ->setConstructorArgs(array(&$this->db))
+ ->getMock();
// pretend all tables exist
$db_tools->expects($this->any())->method('sql_table_exists')
@@ -372,10 +372,10 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
public function test_perform_schema_changes_drop_columns()
{
- $db_tools = $this->getMock('\phpbb\db\tools\tools', array(
- 'sql_column_exists',
- 'sql_column_remove',
- ), array(&$this->db));
+ $db_tools = $this->getMockBuilder('\phpbb\db\tools\tools')
+ ->setMethods(array('sql_column_exists', 'sql_column_remove'))
+ ->setConstructorArgs(array(&$this->db))
+ ->getMock();
// pretend all columns exist
$db_tools->expects($this->any())->method('sql_column_exists')
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php
index e34ee7b59c..46045d2371 100644
--- a/tests/dbal/migrator_tool_module_test.php
+++ b/tests/dbal/migrator_tool_module_test.php
@@ -39,7 +39,7 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $auth = $this->getMock('\phpbb\auth\auth');
+ $auth = $this->createMock('\phpbb\auth\auth');
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
// Correctly set the root path for this test to this directory, so the classes can be found