From 2754950081d05e649e6796237999f3cb4747b7ae Mon Sep 17 00:00:00 2001 From: Rom1-B Date: Tue, 10 Sep 2024 16:17:12 +0200 Subject: [PATCH] phpunit --- phpunit/functional/TicketTest.php | 45 ++++++++++++++----------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/phpunit/functional/TicketTest.php b/phpunit/functional/TicketTest.php index ed7b2632637..919ed450929 100644 --- a/phpunit/functional/TicketTest.php +++ b/phpunit/functional/TicketTest.php @@ -2737,24 +2737,22 @@ public function testAssignChangeStatus() $this->assertTrue($ticket_user->getFromDB($ticket_user->getId())); // check status (should still be ASSIGNED) - $this->boolean($ticket->getFromDB($tickets_id))->isTrue(); - $this->integer((int) $ticket->fields['status']) - ->isEqualto(\CommonITILObject::ASSIGNED); + $this->assertTrue($ticket->getFromDB($tickets_id)); + $this->assertEquals(\CommonITILObject::ASSIGNED, (int) $ticket->fields['status']); // remove associated user - $this->boolean($ticket->update([ + $this->assertTrue($ticket->update([ 'id' => $tickets_id, '_actors' => [ 'assign' => [] ] - ]))->isTrue(); + ])); // check status (should be INCOMING) - $this->boolean($ticket->getFromDB($tickets_id))->isTrue(); - $this->integer((int) $ticket->fields['status']) - ->isEqualto(\CommonITILObject::INCOMING); + $this->assertTrue($ticket->getFromDB($tickets_id)); + $this->assertEquals(\CommonITILObject::INCOMING, (int) $ticket->fields['status']); // add associated user - $this->boolean($ticket->update([ + $this->assertTrue($ticket->update([ 'id' => $tickets_id, '_actors' => [ 'assign' => [ @@ -2767,14 +2765,13 @@ public function testAssignChangeStatus() ] ] ] - ]))->isTrue(); + ])); // check status (should be ASSIGNED) - $this->boolean($ticket->getFromDB($tickets_id))->isTrue(); - $this->integer((int) $ticket->fields['status']) - ->isEqualto(\CommonITILObject::ASSIGNED); + $this->assertTrue($ticket->getFromDB($tickets_id)); + $this->assertEquals(\CommonITILObject::ASSIGNED, (int) $ticket->fields['status']); // replace associated user - $this->boolean($ticket->update([ + $this->assertTrue($ticket->update([ 'id' => $tickets_id, '_actors' => [ 'assign' => [ @@ -2787,20 +2784,19 @@ public function testAssignChangeStatus() ] ] ] - ]))->isTrue(); + ])); // check status (should still be ASSIGNED) - $this->boolean($ticket->getFromDB($tickets_id))->isTrue(); - $this->integer((int) $ticket->fields['status']) - ->isEqualto(\CommonITILObject::ASSIGNED); + $this->assertTrue($ticket->getFromDB($tickets_id)); + $this->assertEquals(\CommonITILObject::ASSIGNED, (int) $ticket->fields['status']); // change status to WAITING - $this->boolean($ticket->update([ + $this->assertTrue($ticket->update([ 'id' => $tickets_id, 'status' => \CommonITILObject::WAITING - ]))->isTrue(); + ])); // replace associated user - $this->boolean($ticket->update([ + $this->assertTrue($ticket->update([ 'id' => $tickets_id, '_actors' => [ 'assign' => [ @@ -2813,11 +2809,10 @@ public function testAssignChangeStatus() ] ] ] - ]))->isTrue(); + ])); // check status (should still be WAITING) - $this->boolean($ticket->getFromDB($tickets_id))->isTrue(); - $this->integer((int) $ticket->fields['status']) - ->isEqualto(\CommonITILObject::WAITING); + $this->assertTrue($ticket->getFromDB($tickets_id)); + $this->assertEquals(\CommonITILObject::WAITING, (int) $ticket->fields['status']); } public function testClosedTicketTransfer()