From 00071401d7c16e700becf5447bebdc70441736ea Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 21 Nov 2013 23:40:25 +0100 Subject: Round out Avatar Public API --- tests/lib/avatar.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/lib') 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()); + } } -- cgit v1.2.3