Esempio n. 1
0
 /**
  * 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();
     }
 }
Esempio n. 2
0
 /**
  * @depends test_group
  */
 public function test_groups($Group)
 {
     $Groups = new Groups();
     $allgroups = $Groups->getGroups();
     $this->assertTrue(is_array($allgroups));
     $this->assertTrue(count($allgroups) > 0);
 }
Esempio n. 3
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();
 }
Esempio n. 4
0
 /**
  * @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();
 }