summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-09-15 21:18:59 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-09-15 21:18:59 +0200
commitad82a56f79fa46fae0742d0647008025e32c3d2b (patch)
tree8b407c82b7e44761cfba105be1f10d17efcfaef7 /tests
parent4480b0b16409c9c2f3fcca34afbd5bd5d2d2a6e2 (diff)
parent339c98e5e69103806f03d1eac660f69d1583c5c2 (diff)
downloadnextcloud-server-ad82a56f79fa46fae0742d0647008025e32c3d2b.tar.gz
nextcloud-server-ad82a56f79fa46fae0742d0647008025e32c3d2b.zip
Merge branch 'master' into appframework-master
Diffstat (limited to 'tests')
-rw-r--r--tests/data/testavatar.pngbin0 -> 3705 bytes
-rw-r--r--tests/lib/avatar.php26
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/data/testavatar.png b/tests/data/testavatar.png
new file mode 100644
index 00000000000..24770fb634f
--- /dev/null
+++ b/tests/data/testavatar.png
Binary files differ
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());
+ }
+}