summaryrefslogtreecommitdiffstats
path: root/tests/lib/avatar.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/avatar.php')
-rw-r--r--tests/lib/avatar.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/lib/avatar.php b/tests/lib/avatar.php
new file mode 100644
index 00000000000..1c5195f8eb1
--- /dev/null
+++ b/tests/lib/avatar.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Copyright (c) 2013 Christopher Schäpers <christopher@schaepers.it>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+class Test_Avatar extends PHPUnit_Framework_TestCase {
+
+ public function testAvatar() {
+ $this->markTestSkipped("Setting custom avatars with encryption doesn't work yet");
+
+ $avatar = new \OC_Avatar(\OC_User::getUser());
+
+ $this->assertEquals(false, $avatar->get());
+
+ $expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png');
+ $avatar->set($expected->data());
+ $expected->resize(64);
+ $this->assertEquals($expected->data(), $avatar->get()->data());
+
+ $avatar->remove();
+ $this->assertEquals(false, $avatar->get());
+ }
+}