-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add version badge to readme, clean up some tests and add some simple …
…ones
- Loading branch information
Showing
8 changed files
with
115 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use App\Models\User; | ||
use Database\Seeders\CostTypeSeeder; | ||
use Tests\TestCase; | ||
|
||
class ExpenseTest extends TestCase | ||
{ | ||
public function test_create_expense_page_is_loaded(): void | ||
{ | ||
$user = User::factory()->createOne(); | ||
|
||
$expensePage = $this->actingAs($user) | ||
->get('/expense/create'); | ||
|
||
$expensePage->assertSeeInOrder([ | ||
'Rechnungsdatum', | ||
'Zahlungseingang', | ||
'Lieferant', | ||
'Produkt', | ||
'Rechnungsnummer', | ||
'Netto', | ||
'Steuer', | ||
'Brutto', | ||
'Typ', | ||
]); | ||
$expensePage->assertStatus(200); | ||
} | ||
|
||
//Create a test, that fills in the create expense form, submits it and checks, if the values are stored in the database. | ||
public function test_create_expense(): void | ||
{ | ||
$user = User::factory()->createOne(); | ||
|
||
$expense = [ | ||
'billing_date' => '2021-01-01', | ||
'payment_date' => '2021-01-02', | ||
'supplier_name' => 'Supplier', | ||
'product_name' => 'Product', | ||
'invoice_number' => '123', | ||
'net' => 100.00, | ||
'tax' => 19.00, | ||
'gross' => 119.00, | ||
'cost_type' => 4, | ||
]; | ||
|
||
$this->actingAs($user) | ||
->post('expense/', $expense); | ||
|
||
$this->assertDatabaseHas('expenses', $expense); | ||
} | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
|
||
$this->withoutMiddleware(\App\Http\Middleware\VerifyCsrfToken::class); | ||
$this->seed(CostTypeSeeder::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Tests\Feature; | ||
|
||
use App\Models\User; | ||
use Tests\TestCase; | ||
|
||
class RevenueTest extends TestCase | ||
{ | ||
public function test_create_revenue_page_is_loaded(): void | ||
{ | ||
$user = User::factory()->create(); | ||
|
||
$revenuePage = $this->actingAs($user) | ||
->get('/revenue/create'); | ||
|
||
$revenuePage->assertSeeInOrder([ | ||
'Rechnungsdatum', | ||
'Zahlungseingang', | ||
'Kunde', | ||
'Rechnungsnummer', | ||
'Netto', | ||
'Steuer', | ||
'Brutto', | ||
]); | ||
$revenuePage->assertStatus(200); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters