Skip to content

Commit

Permalink
fix and expand test
Browse files Browse the repository at this point in the history
  • Loading branch information
cconard96 committed Jan 11, 2024
1 parent 27e508c commit 5ccced5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/functional/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -6464,6 +6464,18 @@ public function testRestrictedDropdownValues()
$idor = \Session::getNewIDORToken(\Ticket::class, $dropdown_params);
$values = \Dropdown::getDropdownValue($dropdown_params + ['_idor_token' => $idor], false);
$this->array($values['results'])->size->isGreaterThan(1);
$this->boolean($fn_dropdown_has_id($values['results'], $not_my_tickets_id))->isFalse();

// Add user as requester
$ticket_user = new \Ticket_User();
$ticket_user->add([
'tickets_id' => $not_my_tickets_id,
'users_id' => $_SESSION['glpiID'],
'type' => CommonITILActor::REQUESTER,
]);
$idor = \Session::getNewIDORToken(\Ticket::class, $dropdown_params);
$values = \Dropdown::getDropdownValue($dropdown_params + ['_idor_token' => $idor], false);
$this->array($values['results'])->size->isGreaterThan(1);
$this->boolean($fn_dropdown_has_id($values['results'], $not_my_tickets_id))->isTrue();
}
}

0 comments on commit 5ccced5

Please sign in to comment.