2013-07-30 18:09:54 +04:00
|
|
|
<?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 {
|
|
|
|
|
2013-08-19 14:15:48 +04:00
|
|
|
public function testAvatar() {
|
2013-08-28 18:39:00 +04:00
|
|
|
$avatar = new \OC_Avatar();
|
|
|
|
|
|
|
|
$this->assertEquals(false, $avatar->get(\OC_User::getUser()));
|
2013-07-30 18:09:54 +04:00
|
|
|
|
|
|
|
$expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png');
|
2013-08-28 18:39:00 +04:00
|
|
|
$avatar->set(\OC_User::getUser(), $expected->data());
|
2013-08-08 19:03:19 +04:00
|
|
|
$expected->resize(64);
|
2013-08-28 18:39:00 +04:00
|
|
|
$this->assertEquals($expected->data(), $avatar->get(\OC_User::getUser())->data());
|
2013-07-30 18:09:54 +04:00
|
|
|
|
2013-08-28 18:39:00 +04:00
|
|
|
$avatar->remove(\OC_User::getUser());
|
|
|
|
$this->assertEquals(false, $avatar->get(\OC_User::getUser()));
|
2013-07-30 18:09:54 +04:00
|
|
|
}
|
|
|
|
}
|