/** * Constructor * @since Version 3.5 * @param int $group_id */ public function __construct($group_id = false) { try { parent::__construct(); } catch (Exception $e) { throw new Exception($e->getMessage()); } if ($group_id) { $this->id = $group_id; $this->fetch(); } }
/** * @depends test_group */ public function test_groups($Group) { $Groups = new Groups(); $allgroups = $Groups->getGroups(); $this->assertTrue(is_array($allgroups)); $this->assertTrue(count($allgroups) > 0); }
/** * Constructor * @since Version 3.5 * @param int $groupId */ public function __construct($groupId = null) { parent::__construct(); if (!filter_var($groupId, FILTER_VALIDATE_INT)) { return; } $this->id = $groupId; $this->fetch(); }
/** * @depends test_newGroup */ public function test_findWithAttribute($Group) { $Group->attributes['test'] = 1; $Group->commit(); $Groups = new Groups(); $Groups->findWithAttribute("test"); $Groups->findWithAttribute("test", 1); $Groups->findWithAttribute("test", "asdfdfa"); $this->setExpectedException("Exception", "Cannot filter groups by attribute - no attribute given!"); $Groups->findWithAttribute(); }