summaryrefslogtreecommitdiffstats
path: root/tests/lib/avatar.php
blob: 321bb771fb4ab5accab6cc39b0ab8dc5ac2f326e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?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() {
		$avatar = new \OC_Avatar();

		$this->assertEquals(false, $avatar->get(\OC_User::getUser()));

		$expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png');
		$avatar->set(\OC_User::getUser(), $expected->data());
		$expected->resize(64);
		$this->assertEquals($expected->data(), $avatar->get(\OC_User::getUser())->data());

		$avatar->remove(\OC_User::getUser());
		$this->assertEquals(false, $avatar->get(\OC_User::getUser()));
	}
}