| @@ 21-31 (lines=11) @@ | ||
| 18 | ||
| 19 | class MmexControllerTest extends AbstractApiTestCase |
|
| 20 | { |
|
| 21 | public function testDeleteAllPayees() |
|
| 22 | { |
|
| 23 | // Arrange |
|
| 24 | $payee = factory(Payee::class)->create(); |
|
| 25 | $url = $this->buildUrl('', ['delete_payee' => 'true']); |
|
| 26 | ||
| 27 | // Act & Assert |
|
| 28 | $this->get($url) |
|
| 29 | ->seeSuccess() |
|
| 30 | ->dontSeeInDatabase('payees', ['name' => $payee->name]); |
|
| 31 | } |
|
| 32 | ||
| 33 | public function testImportPayees() |
|
| 34 | { |
|
| @@ 53-64 (lines=12) @@ | ||
| 50 | ->seeInDatabase('payees', ['name' => 'Spotify', 'last_category_id' => $billsServices->id]); |
|
| 51 | } |
|
| 52 | ||
| 53 | public function testDeleteAllAccounts() |
|
| 54 | { |
|
| 55 | // Arrange |
|
| 56 | $account = factory(Account::class)->create(); |
|
| 57 | $url = $this->buildUrl('', ['delete_bankaccount' => 'true']); |
|
| 58 | ||
| 59 | // Act & Assert |
|
| 60 | $this->get($url) |
|
| 61 | ->seeSuccess() |
|
| 62 | ->dontSeeInDatabase('accounts', ['name' => $account->name]); |
|
| 63 | } |
|
| 64 | ||
| 65 | public function testImportAccounts() |
|
| 66 | { |
|
| 67 | // Arrange |
|
| @@ 78-89 (lines=12) @@ | ||
| 75 | ->seeInDatabase('accounts', ['name' => 'Private Account']); |
|
| 76 | } |
|
| 77 | ||
| 78 | public function testDeleteAllCategories() |
|
| 79 | { |
|
| 80 | // Arrange |
|
| 81 | $categorie = factory(Category::class)->create(); |
|
| 82 | ||
| 83 | $url = $this->buildUrl('', ['delete_category' => 'true']); |
|
| 84 | ||
| 85 | // Act & Assert |
|
| 86 | $this->get($url) |
|
| 87 | ->seeSuccess() |
|
| 88 | ->dontSeeInDatabase('categories', ['name' => $categorie->name]); |
|
| 89 | } |
|
| 90 | ||
| 91 | public function testImportCategories() |
|
| 92 | { |
|
| @@ 10-22 (lines=13) @@ | ||
| 7 | ||
| 8 | class AccountTest extends AbstractMmexTestCase |
|
| 9 | { |
|
| 10 | public function testDeleteAllAccounts() |
|
| 11 | { |
|
| 12 | // Arrange |
|
| 13 | $account = factory(Account::class)->create(); |
|
| 14 | $url = $this->buildUrl('', ['delete_bankaccount' => 'true']); |
|
| 15 | ||
| 16 | // Act |
|
| 17 | $response = $this->get($url); |
|
| 18 | ||
| 19 | // Assert |
|
| 20 | $this->seeSuccess($response); |
|
| 21 | $this->assertDatabaseMissing('accounts', ['name' => $account->name]); |
|
| 22 | } |
|
| 23 | ||
| 24 | public function testImportAccounts() |
|
| 25 | { |
|
| @@ 12-25 (lines=14) @@ | ||
| 9 | class CategoryTest extends AbstractMmexTestCase |
|
| 10 | { |
|
| 11 | ||
| 12 | public function testDeleteAllCategories() |
|
| 13 | { |
|
| 14 | // Arrange |
|
| 15 | $categorie = factory(Category::class)->create(); |
|
| 16 | ||
| 17 | $url = $this->buildUrl('', ['delete_category' => 'true']); |
|
| 18 | ||
| 19 | // Act |
|
| 20 | $response = $this->get($url); |
|
| 21 | ||
| 22 | // Assert |
|
| 23 | $this->seeSuccess($response); |
|
| 24 | $this->assertDatabaseMissing('categories', ['name' => $categorie->name]); |
|
| 25 | } |
|
| 26 | ||
| 27 | public function testImportCategories() |
|
| 28 | { |
|
| @@ 11-23 (lines=13) @@ | ||
| 8 | ||
| 9 | class PayeeTest extends AbstractMmexTestCase |
|
| 10 | { |
|
| 11 | public function testDeleteAllPayees() |
|
| 12 | { |
|
| 13 | // Arrange |
|
| 14 | $payee = factory(Payee::class)->create(); |
|
| 15 | $url = $this->buildUrl('', ['delete_payee' => 'true']); |
|
| 16 | ||
| 17 | // Act |
|
| 18 | $response = $this->get($url); |
|
| 19 | ||
| 20 | // Assert |
|
| 21 | $this->seeSuccess($response); |
|
| 22 | $this->assertDatabaseMissing('payees', ['name' => $payee->name]); |
|
| 23 | } |
|
| 24 | ||
| 25 | public function testImportPayees() |
|
| 26 | { |
|