Example #1
0
 public function testSaveRights()
 {
     $this->markTestSkipped('Do not use Helpdesk model outside of Helpdesk tests');
     $model = new Helpdesk_Models_Helpdesk(array('db' => $this->sharedFixture));
     $model->title = 'test';
     $model->projectId = 1;
     $model->ownerId = 1;
     $model->attachments = '3bc3369dd33d3ab9c03bd76262cff633|LICENSE';
     $model->status = 3;
     $model->author = 1;
     $model->save();
     $model->saveRights(array(1 => 255));
     $rights = new Phprojekt_Item_Rights();
     $this->assertEquals(255, $rights->getItemRight(10, $model->id, 1));
     $this->assertEquals(0, $rights->getItemRight(10, $model->id, 10));
 }
Example #2
0
 public function testSaveRights()
 {
     $model = new Helpdesk_Models_Helpdesk(array('db' => $this->sharedFixture));
     $model->title = 'test';
     $model->projectId = 1;
     $model->ownerId = 1;
     $model->attachments = '3bc3369dd33d3ab9c03bd76262cff633|LICENSE';
     $model->status = 3;
     $model->author = 1;
     $model->save();
     $model->saveRights(array(1 => 255));
     $rights = Phprojekt_Loader::getLibraryClass('Phprojekt_Item_Rights');
     $this->assertEquals(255, $rights->getItemRight(10, $model->id, 1));
     $this->assertEquals(0, $rights->getItemRight(10, $model->id, 10));
 }