Ejemplo n.º 1
0
 /**
  * Update hasMany relations
  */
 public function testUpdateHasManyAndBelongsToMany()
 {
     try {
         $group = new Phprojekt_Groups_Groups(array('db' => $this->sharedFixture));
         $group->find(2);
         $group->id = 10;
         $group->save();
         $users = $group->users->fetchAll();
         $this->assertEquals(2, $users[0]->userId);
         $this->assertEquals('gus', $users[0]->username);
         $group->find(10);
         $group->id = 2;
         $group->save();
     } catch (Exception $e) {
         $this->fail($e->getMessage());
     }
 }
Ejemplo n.º 2
0
 /**
  * Test for mock function
  */
 public function testMocks()
 {
     $group = new Phprojekt_Groups_Groups($this->sharedFixture);
     $this->assertEquals(array(), $group->getRights());
     $this->assertTrue($group->recordValidate());
 }