Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rautenberg committed Apr 9, 2024
1 parent 428c193 commit e7dab81
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/org/openpsa/invoices/handler/invoice/actionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,23 @@ public function testHandler_create_pdf()
midcom::get()->auth->drop_sudo();
}

public function testHandler_create_reminder()
{
midcom::get()->auth->request_sudo('org.openpsa.invoices');

$topic = $this->create_object(midcom_db_topic::class, ['component' => 'org.openpsa.invoices']);
$topic->set_parameter('org.openpsa.invoices', 'invoice_pdfbuilder_reminder_class', 'nonexistent');
$_SERVER['REQUEST_METHOD'] = 'POST';
$_POST = [
'id' => self::$_invoice->id,
'relocate' => true
];
$url = $this->run_relocate_handler($topic, ['invoice', 'action', 'create_reminder']);
$this->assertEquals('invoice/' . self::$_invoice->guid . '/', $url);

midcom::get()->auth->drop_sudo();
}

public function testHandler_mark_sent()
{
midcom::get()->auth->request_sudo('org.openpsa.invoices');
Expand Down

0 comments on commit e7dab81

Please sign in to comment.