diff options
author | rxu <rxu@mail.ru> | 2017-03-19 21:46:20 +0700 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2019-05-08 21:57:00 +0200 |
commit | 42b7782927713c2ca2fb704db6217016347b586e (patch) | |
tree | 74d749f282d9087aa658eec91b73b461ffdc5b73 /tests/test_framework | |
parent | cdf3aa27df099eb440fb279ac50d1fe42e7b136c (diff) | |
download | forums-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/test_framework')
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 10 | ||||
-rw-r--r-- | tests/test_framework/phpbb_session_test_case.php | 2 | ||||
-rw-r--r-- | tests/test_framework/phpbb_test_case_helpers.php | 8 |
3 files changed, 13 insertions, 7 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 4d294fd523..9351ab3f4a 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -632,11 +632,11 @@ class phpbb_functional_test_case extends phpbb_test_case $db = $this->get_db(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); - $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); $cache = new phpbb_mock_null_cache; @@ -674,17 +674,17 @@ class phpbb_functional_test_case extends phpbb_test_case $db = $this->get_db(); $phpbb_dispatcher = new phpbb_mock_event_dispatcher(); - $user = $this->getMock('\phpbb\user', array(), array( + $user = $this->createMock('\phpbb\user', array(), array( new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx)), '\phpbb\datetime' )); - $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); $cache = new phpbb_mock_null_cache; $cache_driver = new \phpbb\cache\driver\dummy(); - $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface'); + $phpbb_container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface'); $phpbb_container ->expects($this->any()) ->method('get') diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php index b3d7780d14..1e71ca6e69 100644 --- a/tests/test_framework/phpbb_session_test_case.php +++ b/tests/test_framework/phpbb_session_test_case.php @@ -37,7 +37,7 @@ abstract class phpbb_session_test_case extends phpbb_database_test_case $phpbb_path_helper = new \phpbb\path_helper( $symfony_request, $phpbb_filesystem, - $this->getMock('\phpbb\request\request'), + $this->createMock('\phpbb\request\request'), $phpbb_root_path, $phpEx ); diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index c792976b1e..c8ff7ba72b 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -382,10 +382,16 @@ class phpbb_test_case_helpers } // Mock the DAL, make it return data from the fixture + $db_driver = $this->test_case->getMockBuilder('phpbb\\db\\driver\\driver') + ->disableOriginalConstructor() + ->disableOriginalClone() + ->disableArgumentCloning() + ->disallowMockingUnknownTypes() + ->getMock(); $mb = $this->test_case->getMockBuilder('phpbb\\textformatter\\data_access'); $mb->setMethods(array('get_bbcodes', 'get_censored_words', 'get_smilies', 'get_styles')); $mb->setConstructorArgs(array( - $this->test_case->getMockBuilder('phpbb\\db\\driver\\driver')->getMock(), + $db_driver, 'phpbb_bbcodes', 'phpbb_smilies', 'phpbb_styles', |