summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-22 12:56:53 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-25 20:05:11 +0100
commit68ef6e1bdd88458259c499e7b0729a7ab92546e8 (patch)
tree5c760d8170f51eaf277c8cfc4ccc5e9447b3f4aa /tests/lib
parentf165ad8864e5bdb213bdeb06d96b66612cee4fef (diff)
downloadnextcloud-server-68ef6e1bdd88458259c499e7b0729a7ab92546e8.tar.gz
nextcloud-server-68ef6e1bdd88458259c499e7b0729a7ab92546e8.zip
Assert that User::triggerChange is called upon avatar change
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/avatartest.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/avatartest.php b/tests/lib/avatartest.php
index 2e7ec00428f..264ce163e27 100644
--- a/tests/lib/avatartest.php
+++ b/tests/lib/avatartest.php
@@ -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());
}