avatar.php 666 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Christopher Schäpers <christopher@schaepers.it>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. class Test_Avatar extends PHPUnit_Framework_TestCase {
  9. public function testAvatar() {
  10. $avatar = new \OC_Avatar(\OC_User::getUser());
  11. $this->assertEquals(false, $avatar->get());
  12. $expected = new OC_Image(\OC::$SERVERROOT.'/tests/data/testavatar.png');
  13. $expected->resize(64);
  14. $avatar->set($expected->data());
  15. $this->assertEquals($expected->data(), $avatar->get()->data());
  16. $avatar->remove();
  17. $this->assertEquals(false, $avatar->get());
  18. }
  19. }