Assert that User::triggerChange is called upon avatar change
This commit is contained in:
parent
f165ad8864
commit
68ef6e1bdd
1 changed files with 7 additions and 3 deletions
|
@ -16,6 +16,9 @@ class AvatarTest extends \Test\TestCase {
|
|||
/** @var \OC\Avatar */
|
||||
private $avatar;
|
||||
|
||||
/** @var \OC\User\User | PHPUnit_Framework_MockObject_MockObject $user */
|
||||
private $user;
|
||||
|
||||
public function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
|
@ -23,9 +26,8 @@ class AvatarTest extends \Test\TestCase {
|
|||
/** @var \OCP\IL10N | PHPUnit_Framework_MockObject_MockObject $l */
|
||||
$l = $this->getMock('\OCP\IL10N');
|
||||
$l->method('t')->will($this->returnArgument(0));
|
||||
/** @var \OC\User\User | PHPUnit_Framework_MockObject_MockObject $user */
|
||||
$user = $this->getMockBuilder('\OC\User\User')->disableOriginalConstructor()->getMock();
|
||||
$this->avatar = new \OC\Avatar($this->folder, $l, $user);
|
||||
$this->user = $this->getMockBuilder('\OC\User\User')->disableOriginalConstructor()->getMock();
|
||||
$this->avatar = new \OC\Avatar($this->folder, $l, $this->user);
|
||||
}
|
||||
|
||||
public function testGetNoAvatar() {
|
||||
|
@ -161,6 +163,8 @@ class AvatarTest extends \Test\TestCase {
|
|||
->method('putContent')
|
||||
->with($image->data());
|
||||
|
||||
$this->user->expects($this->once())->method('triggerChange');
|
||||
|
||||
$this->avatar->set($image->data());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue