Skip to content

Commit 2560c59

Browse files
LainowRom1-B
authored andcommitted
Fix units tests
1 parent 598ba8d commit 2560c59

File tree

3 files changed

+181
-203
lines changed

3 files changed

+181
-203
lines changed

tests/EscaladeTestCase.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,15 @@ public function climbWithHistoryButton(\Ticket $ticket, \Group $group): void
113113

114114
public function climbWithSolvedTicket(\Ticket $ticket, \Group $group, array $solution_options = []): void
115115
{
116-
$this->createItem(\ITILSolution::class, array_merge([
116+
$solution = new \ITILSolution();
117+
$solution_id = $solution->add(array_merge([
117118
'content' => 'Test Solution',
118119
'itemtype' => $ticket->getType(),
119120
'items_id' => $ticket->getID(),
120121
'users_id' => Session::getLoginUserID(),
121122
], $solution_options));
123+
$this->assertGreaterThan(0, $solution_id);
124+
122125
$ticketgroup = new \Group_Ticket();
123126
$is_escalate = $ticketgroup->getFromDBByCrit([
124127
'tickets_id' => $ticket->getID(),
@@ -130,18 +133,16 @@ public function climbWithSolvedTicket(\Ticket $ticket, \Group $group, array $sol
130133
public function climbWithRejectSolutionTicket(\Ticket $ticket, \Group $group, array $followup_options = []): void
131134
{
132135
$_POST['add_reopen'] = 1;
133-
$this->createItem(
134-
\ITILFollowup::class,
135-
array_merge([
136-
'itemtype' => 'Ticket',
137-
'items_id' => $ticket->getID(),
138-
'add_reopen' => '1',
139-
'content' => 'reopen followup',
140-
], $followup_options),
141-
[
142-
'add_reopen',
143-
],
144-
);
136+
137+
$followup = new \ITILFollowup();
138+
$followup_id = $followup->add(array_merge([
139+
'itemtype' => 'Ticket',
140+
'items_id' => $ticket->getID(),
141+
'add_reopen' => '1',
142+
'content' => 'reopen followup',
143+
], $followup_options));
144+
$this->assertGreaterThan(0, $followup_id);
145+
145146
$ticketgroup = new \Group_Ticket();
146147
$is_escalate = $ticketgroup->getFromDBByCrit([
147148
'tickets_id' => $ticket->getID(),

0 commit comments

Comments
 (0)