mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
More tests for generated numbers
This commit is contained in:
parent
a1d6c78642
commit
1292098b65
@ -68,6 +68,10 @@ class GeneratesCounterTest extends TestCase
|
||||
$this->assertEquals($date_formatted."-0001", $invoice_number);
|
||||
$invoice_number = $this->getNextInvoiceNumber($this->client->fresh(), $this->invoice->fresh());
|
||||
$this->assertEquals($date_formatted."-0002", $invoice_number);
|
||||
$invoice_number = $this->getNextInvoiceNumber($this->client->fresh(), $this->invoice->fresh());
|
||||
$this->assertEquals($date_formatted."-0003", $invoice_number);
|
||||
$invoice_number = $this->getNextInvoiceNumber($this->client->fresh(), $this->invoice->fresh());
|
||||
$this->assertEquals($date_formatted."-0004", $invoice_number);
|
||||
|
||||
$settings->reset_counter_date = now($timezone->name)->format('Y-m-d');
|
||||
$settings->reset_counter_frequency_id = RecurringInvoice::FREQUENCY_DAILY;
|
||||
@ -83,6 +87,20 @@ class GeneratesCounterTest extends TestCase
|
||||
$invoice_number = $this->getNextInvoiceNumber($this->client->fresh(), $this->invoice->fresh());
|
||||
$this->assertEquals($date_formatted."-0001", $invoice_number);
|
||||
|
||||
$invoice_number = $this->getNextInvoiceNumber($this->client->fresh(), $this->invoice->fresh());
|
||||
$this->assertEquals($date_formatted."-0002", $invoice_number);
|
||||
|
||||
|
||||
$settings->reset_counter_date = now($timezone->name)->format('Y-m-d');
|
||||
$settings->reset_counter_frequency_id = RecurringInvoice::FREQUENCY_DAILY;
|
||||
$this->company->settings = $settings;
|
||||
$this->company->save();
|
||||
|
||||
$this->travel(5)->days();
|
||||
$date_formatted = now($timezone->name)->format('Ymd');
|
||||
|
||||
$invoice_number = $this->getNextInvoiceNumber($this->client->fresh(), $this->invoice->fresh());
|
||||
$this->assertEquals($date_formatted."-0001", $invoice_number);
|
||||
}
|
||||
|
||||
public function testHasSharedCounter()
|
||||
|
Loading…
x
Reference in New Issue
Block a user