aboutsummaryrefslogtreecommitdiffstats
path: root/tests/attachment
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/attachment
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/attachment')
-rw-r--r--tests/attachment/delete_test.php4
-rw-r--r--tests/attachment/upload_test.php13
2 files changed, 9 insertions, 8 deletions
diff --git a/tests/attachment/delete_test.php b/tests/attachment/delete_test.php
index f1835dd37a..5ea9f26ea0 100644
--- a/tests/attachment/delete_test.php
+++ b/tests/attachment/delete_test.php
@@ -47,7 +47,7 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case
$this->db = $this->new_dbal();
$db = $this->db;
$this->resync = new \phpbb\attachment\resync($this->db);
- $this->filesystem = $this->getMock('\phpbb\filesystem\filesystem', array('remove', 'exists'));
+ $this->filesystem = $this->createMock('\phpbb\filesystem\filesystem', array('remove', 'exists'));
$this->filesystem->expects($this->any())
->method('remove')
->willReturn(false);
@@ -103,7 +103,7 @@ class phpbb_attachment_delete_test extends \phpbb_database_test_case
*/
public function test_attachment_delete_success($remove_success, $exists_success, $expected, $throw_exception = false)
{
- $this->filesystem = $this->getMock('\phpbb\filesystem\filesystem', array('remove', 'exists'));
+ $this->filesystem = $this->createMock('\phpbb\filesystem\filesystem', array('remove', 'exists'));
if ($throw_exception)
{
$this->filesystem->expects($this->any())
diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php
index 235ecd082a..6aaae6ad61 100644
--- a/tests/attachment/upload_test.php
+++ b/tests/attachment/upload_test.php
@@ -81,7 +81,7 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
$config = $this->config;
$this->db = $this->new_dbal();
$this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\dummy(), $this->config, $this->db, $phpbb_root_path, $phpEx);
- $this->request = $this->getMock('\phpbb\request\request');
+ $this->request = $this->createMock('\phpbb\request\request');
$this->filesystem = new \phpbb\filesystem\filesystem();
$this->language = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
@@ -336,14 +336,14 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
*/
public function test_image_upload($is_image, $plupload_active, $config_data, $expected)
{
- $filespec = $this->getMock('\phpbb\files\filespec',
- array(
+ $filespec = $this->getMockBuilder('\phpbb\files\filespec')
+ ->setMethods(array(
'init_error',
'is_image',
'move_file',
'is_uploaded',
- ),
- array(
+ ))
+ ->setConstructorArgs(array(
$this->filesystem,
$this->language,
$this->php_ini,
@@ -351,7 +351,8 @@ class phpbb_attachment_upload_test extends \phpbb_database_test_case
$this->phpbb_root_path,
$this->mimetype_guesser,
$this->plupload
- ));
+ ))
+ ->getMock();
foreach ($config_data as $key => $value)
{
$this->config[$key] = $value;