aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/avatar.php
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-19 12:15:48 +0200
committerkondou <kondou@ts.unde.re>2013-08-25 21:06:02 +0200
commit81cadd5ea37f1db30cdd085dc58a27ef8a9ee5c2 (patch)
tree0b969f6246bd80f989cea6d903e08e6ff9260fe8 /tests/lib/avatar.php
parent960262bbb469f8418ac590c5e4d789568d7c9a7e (diff)
downloadnextcloud-server-81cadd5ea37f1db30cdd085dc58a27ef8a9ee5c2.tar.gz
nextcloud-server-81cadd5ea37f1db30cdd085dc58a27ef8a9ee5c2.zip
Remove gravatar and no-avatar functionality, prepare for default avatars even more and reword some stuff
Diffstat (limited to 'tests/lib/avatar.php')
-rw-r--r--tests/lib/avatar.php38
1 files changed, 5 insertions, 33 deletions
diff --git a/tests/lib/avatar.php b/tests/lib/avatar.php
index 0e1aa3d9f62..42b06f8bccb 100644
--- a/tests/lib/avatar.php
+++ b/tests/lib/avatar.php
@@ -8,51 +8,23 @@
class Test_Avatar extends PHPUnit_Framework_TestCase {
- public function testModes() {
- $this->assertEquals('local', \OC_Avatar::getMode());
-
- \OC_Config::setValue('avatar', 'local');
- $this->assertEquals('local', \OC_Avatar::getMode());
-
- \OC_Config::setValue('avatar', 'gravatar');
- $this->assertEquals('gravatar', \OC_Avatar::getMode());
-
- \OC_Config::setValue('avatar', 'none');
- $this->assertEquals('none', \OC_Avatar::getMode());
- }
-
- public function testDisabledAvatar() {
- \OC_Config::setValue('avatar', 'none');
- $this->assertFalse(\OC_Avatar::get(\OC_User::getUser()));
- $this->assertFalse(\OC_Avatar::get(\OC_User::getUser(), 32));
- }
-
- public function testLocalAvatar() {
- \OC_Config::setValue('avatar', 'local');
+ public function testAvatar() {
$expected = \OC_Avatar::getDefaultAvatar()->data();
$this->assertEquals($expected, \OC_Avatar::get(\OC_User::getUser())->data());
$expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png');
- \OC_Avatar::setLocalAvatar(\OC_User::getUser(), $expected->data());
+ \OC_Avatar::set(\OC_User::getUser(), $expected->data());
$expected->resize(64);
$this->assertEquals($expected->data(), \OC_Avatar::get(\OC_User::getUser())->data());
- \OC_Avatar::setLocalAvatar(\OC_User::getUser(), false);
+ \OC_Avatar::set(\OC_User::getUser(), false);
$expected = \OC_Avatar::getDefaultAvatar()->data();
$this->assertEquals($expected, \OC_Avatar::get(\OC_User::getUser())->data());
}
- public function testGravatar() {
- \OC_Preferences::setValue(\OC_User::getUser(), 'settings', 'email', 'someone@example.com');
- \OC_Config::setValue('avatar', 'gravatar');
- $expected = "http://www.gravatar.com/avatar/".md5("someone@example.com")."?s=";
- $this->assertEquals($expected."64", \OC_Avatar::get(\OC_User::getUser()));
- $this->assertEquals($expected."32", \OC_Avatar::get(\OC_User::getUser(), 32));
- }
-
- public function testDefaultAvatar() {
+ /*public function testDefaultAvatar() {
$img = new \OC_Image(OC::$SERVERROOT.'/core/img/defaultavatar.png');
$img->resize(128);
$this->assertEquals($img->data(), \OC_Avatar::getDefaultAvatar(\OC_User::getUser(), 128)->data());
- }
+ }*/
}