diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-11-21 23:40:25 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-11-21 23:40:25 +0100 |
commit | 00071401d7c16e700becf5447bebdc70441736ea (patch) | |
tree | e6d4617ab0d4a382e352ef0788869d7eaf3baa95 /tests/lib | |
parent | bcd776b0c0480291c793c89ba36477163c9e4249 (diff) | |
download | nextcloud-server-00071401d7c16e700becf5447bebdc70441736ea.tar.gz nextcloud-server-00071401d7c16e700becf5447bebdc70441736ea.zip |
Round out Avatar Public API
Diffstat (limited to 'tests/lib')
-rw-r--r-- | tests/lib/avatar.php | 15 |
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()); + } } |