ElggUserTest.php 573 B

12345678910111213141516171819202122
  1. <?php
  2. class ElggUserTest extends \PHPUnit_Framework_TestCase {
  3. protected function setUp() {
  4. // required by \ElggEntity when setting the owner/container
  5. _elgg_services()->setValue('session', \ElggSession::getMock());
  6. }
  7. public function testCanConstructWithoutArguments() {
  8. $this->assertNotNull(new \ElggUser());
  9. }
  10. public function testSettingUnsettableAttributes() {
  11. $obj = new \ElggUser();
  12. foreach (array('prev_last_action', 'last_login', 'prev_last_login') as $name) {
  13. $obj->$name = 'foo';
  14. $this->assertNotEquals('foo', $obj->$name);
  15. }
  16. }
  17. }