/** * Test count of images in album */ public function testAlbumImageCount() { $user = GalleryTestLib::createUser(); $album = GalleryTestLib::createAlbum($user->guid); $expected_count = 5; for ($i = 0; $i < $expected_count; $i++) { GalleryTestLib::createImage($user->guid, $album->guid); } $actual_count = $album->countImages(); $this->assertEqual($actual_count, $expected_count); $user->delete(); }
/** * Called before each test method. */ public function setUp() { $this->owner = GalleryTestLib::createUser(); $this->friend = GalleryTestLib::createUser(); $this->owner->addFriend($this->friend->getGUID()); $this->third_party = GalleryTestLib::createUser(); $this->group_owner = GalleryTestLib::createUser(); $this->member_in_group = GalleryTestLib::createUser(); $this->group = GalleryTestLib::createGroup($this->group_owner->getGUID()); $this->group->join($this->owner); $this->group->join($this->member_in_group); $this->user_album = GalleryTestLib::createAlbum($this->owner->getGUID(), $this->owner->getGUID()); $this->group_album = GalleryTestLib::createAlbum($this->owner->getGUID(), $this->group->getGUID()); $this->ia = elgg_set_ignore_access(false); }