aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/avatar.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/avatar.php')
-rw-r--r--tests/lib/avatar.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/lib/avatar.php b/tests/lib/avatar.php
index 6e6faed2d2c..9cc14865a29 100644
--- a/tests/lib/avatar.php
+++ b/tests/lib/avatar.php
@@ -22,4 +22,19 @@ class Test_Avatar extends PHPUnit_Framework_TestCase {
$avatar->remove();
$this->assertEquals(false, $avatar->get());
}
+
+ public function testAvatarApi() {
+ $avatarManager = \OC::$server->getAvatarManager();
+ $avatar = $avatarManager->getAvatar(\OC_User::getUser());
+
+ $this->assertEquals(false, $avatar->get());
+
+ $expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png');
+ $expected->resize(64);
+ $avatar->set($expected->data());
+ $this->assertEquals($expected->data(), $avatar->get()->data());
+
+ $avatar->remove();
+ $this->assertEquals(false, $avatar->get());
+ }
}