|
|
|
@ -7,6 +7,11 @@ use App\Entities\Projects\Project; |
|
|
|
use App\Entities\Users\User; |
|
|
|
use Tests\TestCase; |
|
|
|
|
|
|
|
/** |
|
|
|
* Invoice Model Test. |
|
|
|
* |
|
|
|
* @author Nafies Luthfi <nafiesl@gmail.com> |
|
|
|
*/ |
|
|
|
class InvoiceTest extends TestCase |
|
|
|
{ |
|
|
|
/** @test */ |
|
|
|
@ -39,4 +44,19 @@ class InvoiceTest extends TestCase |
|
|
|
$invoice2 = factory(Invoice::class)->create(); |
|
|
|
$this->assertEquals(date('ym').'002', $invoice2->number); |
|
|
|
} |
|
|
|
|
|
|
|
/** @test */ |
|
|
|
public function it_has_number_link_method() |
|
|
|
{ |
|
|
|
$invoice = factory(Invoice::class)->make(); |
|
|
|
|
|
|
|
$this->assertEquals( |
|
|
|
link_to_route('invoices.show', $invoice->number, [$invoice->number], [ |
|
|
|
'title' => trans( |
|
|
|
'app.show_detail_title', |
|
|
|
['name' => $invoice->number, 'type' => trans('invoice.invoice')] |
|
|
|
), |
|
|
|
]), $invoice->numberLink() |
|
|
|
); |
|
|
|
} |
|
|
|
} |