Merge pull request #5333 from owncloud/avater_with_encryption

avatars should also work with encryption after pr #5332 was merged
This commit is contained in:
Björn Schießle 2013-10-16 01:34:05 -07:00
commit ada94fb558
2 changed files with 1 additions and 6 deletions

View File

@ -51,10 +51,6 @@ class OC_Avatar {
* @return void
*/
public function set ($data) {
if (\OC_App::isEnabled('files_encryption')) {
$l = \OC_L10N::get('lib');
throw new \Exception($l->t("Custom profile pictures don't work with encryption yet"));
}
$img = new OC_Image($data);
$type = substr($img->mimeType(), -3);

View File

@ -9,15 +9,14 @@
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);
$avatar->set($expected->data());
$this->assertEquals($expected->data(), $avatar->get()->data());
$avatar->remove();