1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-06 16:56:44 +02:00

[ticket/14972] Migrate from deprecated getMock() method to createMock()

PHPBB3-14972
This commit is contained in:
rxu
2017-03-19 21:46:20 +07:00
parent 055a5f8040
commit e3859d894d
70 changed files with 168 additions and 141 deletions

View File

@@ -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())

View File

@@ -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;