mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/13981] Add events to capture avatar deletion or overwriting
An event to capture overwriting, and another to capture deletion. Includes better error processing. Replaced global by dependency injection. Fix Travis tests. PHPBB3-13981
This commit is contained in:
parent
11256cd167
commit
e37b3495f0
1 changed files with 3 additions and 1 deletions
|
@ -56,6 +56,8 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||||
);
|
);
|
||||||
$guesser = new \phpbb\mimetype\guesser($guessers);
|
$guesser = new \phpbb\mimetype\guesser($guessers);
|
||||||
|
|
||||||
|
$dispatcher = new phpbb_mock_event_dispatcher();
|
||||||
|
|
||||||
// $this->avatar_foobar will be needed later on
|
// $this->avatar_foobar will be needed later on
|
||||||
$this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
|
$this->avatar_foobar = $this->getMock('\phpbb\avatar\driver\foobar', array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $cache));
|
||||||
$this->avatar_foobar->expects($this->any())
|
$this->avatar_foobar->expects($this->any())
|
||||||
|
@ -76,7 +78,7 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $cache));
|
$cur_avatar = $this->getMock('\phpbb\avatar\driver\\' . $driver, array('get_name'), array($this->config, $phpbb_root_path, $phpEx, $path_helper, $guesser, $dispatcher, $cache));
|
||||||
}
|
}
|
||||||
$cur_avatar->expects($this->any())
|
$cur_avatar->expects($this->any())
|
||||||
->method('get_name')
|
->method('get_name')
|
||||||
|
|
Loading…
Add table
Reference in a new issue