diff --git a/tests/avatar/driver_gravatar_test.php b/tests/avatar/driver_gravatar_test.php index fbc50d5623c..d0a83c2f22e 100644 --- a/tests/avatar/driver_gravatar_test.php +++ b/tests/avatar/driver_gravatar_test.php @@ -48,25 +48,27 @@ protected function setUp(): void $this->config = new \phpbb\config\config(array()); $this->request = $this->getMockBuilder(request::class) ->disableOriginalConstructor() - ->onlyMethods(['get_super_global']) + ->setMethods(['get_super_global']) ->getMock(); $this->request->method('get_super_global') ->willReturn([]); $this->template = $this->getMockBuilder(\phpbb\template\twig\twig::class) ->disableOriginalConstructor() - ->onlyMethods(['assign_vars']) + ->setMethods(['assign_vars']) ->getMock(); $this->template->method('assign_vars') ->will($this->returnCallback([$this, 'template_assign_vars'])); $this->user = $this->getMockBuilder(\phpbb\user::class) ->disableOriginalConstructor() ->getMock(); + $filesystem = new \phpbb\filesystem\filesystem(); $imagesize = new \FastImageSize\FastImageSize(); $cache = $this->createMock('\phpbb\cache\driver\driver_interface'); $path_helper = new \phpbb\path_helper( new \phpbb\symfony_request( $this->request ), + $filesystem, $this->request, $phpbb_root_path, $phpEx @@ -75,10 +77,10 @@ protected function setUp(): void global $phpbb_dispatcher; $phpbb_dispatcher = $this->getMockBuilder(\phpbb\event\dispatcher::class) ->disableOriginalConstructor() - ->onlyMethods(['trigger_event']) + ->setMethods(['trigger_event']) ->getMock(); $phpbb_dispatcher->method('trigger_event') - ->willReturn($this->returnArgument(1)); + ->willReturnArgument(1); $this->gravatar = new gravatar($this->config, $imagesize, $phpbb_root_path, $phpEx, $path_helper, $cache); $this->gravatar->set_name('avatar.driver.gravatar'); @@ -160,7 +162,7 @@ public function test_prepare_form($expected_vars, $request_data, $row) $request = $this->getMockBuilder(request::class) ->disableOriginalConstructor() - ->onlyMethods(['get_super_global']) + ->setMethods(['get_super_global']) ->getMock(); $request->method('get_super_global') ->willReturn([]); @@ -194,7 +196,7 @@ public function test_gravatar_misc(): void 'avatar_width' => '70', 'avatar_height' => '60', ]; - $this->assertEquals('', $this->gravatar->get_custom_html($this->user, $row)); + $this->assertEquals('', $this->gravatar->get_custom_html($this->user, $row)); } public function test_get_data(): void