/** * Test getTo method */ public function testGetNotificationRecipients() { $helpdeskModel = new Helpdesk_Models_Helpdesk(); $helpdeskModel->find(1); $response = $helpdeskModel->getNotification()->getTo(); $expected = array(); $this->assertEquals($expected, $response); $helpdeskModel->find(2); $helpdeskModel->assigned = 2; $helpdeskModel->save(); $helpdeskModel->assigned = 1; $helpdeskModel->save(); $response = $helpdeskModel->getNotification()->getTo(); $expected = array(2); $this->assertEquals($expected, $response); }
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)); }
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)); }