diff options
author | kondou <kondou@ts.unde.re> | 2013-08-08 17:03:19 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-08-25 21:04:49 +0200 |
commit | 4521b54c672d4111ee578cb7049aca53c79a5eef (patch) | |
tree | 61079b79bc5d793c8f37675cba0a584d345cdf3d /tests | |
parent | 252548c62cf099e5186ffc323e3cf9494fae3768 (diff) | |
download | nextcloud-server-4521b54c672d4111ee578cb7049aca53c79a5eef.tar.gz nextcloud-server-4521b54c672d4111ee578cb7049aca53c79a5eef.zip |
Have /avatar.php as a central avatar-point
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/avatar.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/lib/avatar.php b/tests/lib/avatar.php index 551e4e4ec46..3320ec07e0c 100644 --- a/tests/lib/avatar.php +++ b/tests/lib/avatar.php @@ -29,15 +29,17 @@ class Test_Avatar extends PHPUnit_Framework_TestCase { public function testLocalAvatar() { \OC_Config::setValue('avatar', 'local'); - $this->assertEquals(\OC_Avatar::get(\OC_User::getUser()), \OC_Avatar::wrapIntoImg(\OC_Avatar::getDefaultAvatar(), 'png')); + $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()); - $expected->resize(32); - $this->assertEquals($expected, \OC_Avatar::get(\OC_User::getUser())); + $expected->resize(64); + $this->assertEquals($expected->data(), \OC_Avatar::get(\OC_User::getUser())->data()); \OC_Avatar::setLocalAvatar(\OC_User::getUser(), false); - $this->assertEquals(\OC_Avatar::get(\OC_User::getUser()), \OC_Avatar::wrapIntoImg(\OC_Avatar::getDefaultAvatar(), 'png')); + $expected = \OC_Avatar::getDefaultAvatar()->data(); + $this->assertEquals($expected, \OC_Avatar::get(\OC_User::getUser())->data()); } public function testGravatar() { @@ -51,11 +53,6 @@ class Test_Avatar extends PHPUnit_Framework_TestCase { public function testDefaultAvatar() { $img = new \OC_Image(OC::$SERVERROOT.'/core/img/defaultavatar.png'); $img->resize(128); - $this->assertEquals((string)$img, \OC_Avatar::getDefaultAvatar(128)); - } - - public function testWrapIntoImg() { - $expected = "data:image/test;base64,DUMMY==123=="; - $this->assertEquals($expected, \OC_Avatar::wrapIntoImg("DUMMY==123==", "test")); + $this->assertEquals($img->data(), \OC_Avatar::getDefaultAvatar(128)->data()); } } |