Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add _do_not_compute_takeintoaccount in Common Task #18527

Open
wants to merge 10 commits into
base: 10.0/bugfixes
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Add units test
  • Loading branch information
Lainow committed Dec 11, 2024
commit eeac668d99b3094c95fdd87f60b9640704ad9eb1
27 changes: 26 additions & 1 deletion phpunit/functional/TicketTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
use TicketValidation;
use User;
use Session;
use Ticket;

/* Test for inc/ticket.class.php */

Expand Down Expand Up @@ -7651,7 +7652,31 @@ public function testGlobalValidationUpdate(): void
'status' => \CommonITILValidation::REFUSED,
]);


$this->assertEquals(\CommonITILValidation::REFUSED, TicketValidation::computeValidationStatus($ticket));
}

public function testDoNotComputeTakeIntoAccount(): void
{
$this->login();

$ticket = $this->createItem('Ticket', [
'name' => 'Do Not Compute Take Into Account Ticket',
'content' => 'Do Not Compute Take Into Account Ticket',
]);

$this->assertEquals(0, $ticket->fields['takeintoaccount_delay_stat']);

$task = new \TicketTask();
$task->add([
'tickets_id' => $ticket->getID(),
'is_private' => true,
'state' => \Planning::INFO,
'content' => 'Do Not Compute Take Into Account Task',
'_do_not_compute_takeintoaccount' => true
]);

$t = new Ticket();
$t->getFromDB($ticket->getID());
$this->assertEquals(0, $t->fields['takeintoaccount_delay_stat']);
}
}
Loading