diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php
deleted file mode 100644
index 74a0a460d6..0000000000
--- a/tests/ExampleTest.php
+++ /dev/null
@@ -1,27 +0,0 @@
-visit('/')
- ->see('Firefly');
- }
-}
diff --git a/tests/acceptance/Controllers/AccountControllerTest.php b/tests/acceptance/Controllers/AccountControllerTest.php
deleted file mode 100644
index e42a5a8d1a..0000000000
--- a/tests/acceptance/Controllers/AccountControllerTest.php
+++ /dev/null
@@ -1,224 +0,0 @@
-be($this->user());
- $this->call('GET', route('accounts.create', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('
');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('accounts.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::destroy
- */
- public function testDestroy()
- {
- $this->session(['accounts.delete.url' => 'http://localhost/accounts/show/1']);
-
- $repository = $this->mock(AccountRepositoryInterface::class);
- $repository->shouldReceive('find')->withArgs([0])->once()->andReturn(new Account);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('accounts.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('accounts.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::index
- * @covers FireflyIII\Http\Controllers\AccountController::isInArray
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testIndex(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.index', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::show
- * @covers FireflyIII\Http\Controllers\AccountController::periodEntries
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShow(string $range)
- {
- $date = new Carbon;
- $this->session(['start' => $date, 'end' => clone $date]);
-
- $tasker = $this->mock(AccountTaskerInterface::class);
- $tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
- $tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');
-
- // mock repository:
- $repository = $this->mock(AccountRepositoryInterface::class);
- $repository->shouldReceive('oldestJournalDate')->andReturn(clone $date);
- $repository->shouldReceive('getAccountsByType')->andReturn(new Collection);
-
-
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.show', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::showAll
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowAll(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.show.all', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::showByDate
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowByDate(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('accounts.show.date', [1, '2016-01-01']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::store
- */
- public function testStore()
- {
- $this->session(['accounts.create.url' => 'http://localhost']);
- $this->be($this->user());
- $data = [
- 'name' => 'new account ' . rand(1000, 9999),
- 'what' => 'asset',
- ];
-
- $this->call('post', route('accounts.store', ['asset']), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list should have this new account.
- $this->call('GET', route('accounts.index', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- $this->see($data['name']);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\AccountController::update
- */
- public function testUpdate()
- {
- $this->session(['accounts.edit.url' => 'http://localhost']);
- $this->be($this->user());
- $data = [
- 'name' => 'updated account ' . rand(1000, 9999),
- 'active' => 1,
- 'what' => 'asset',
- ];
-
- $this->call('post', route('accounts.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list should have this new account.
- $this->call('GET', route('accounts.index', ['asset']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- $this->see($data['name']);
- }
-}
diff --git a/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php b/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php
deleted file mode 100644
index b212b656fd..0000000000
--- a/tests/acceptance/Controllers/Admin/ConfigurationControllerTest.php
+++ /dev/null
@@ -1,75 +0,0 @@
-be($this->user());
-
- $falseConfig = new Configuration;
- $falseConfig->data = false;
-
- $trueConfig = new Configuration;
- $trueConfig->data = true;
-
- FireflyConfig::shouldReceive('get')->withArgs(['single_user_mode', true])->once()->andReturn($trueConfig);
- FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->times(2)->andReturn($falseConfig);
-
- $this->call('GET', route('admin.configuration.index'));
- $this->assertResponseStatus(200);
-
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::postIndex
- */
- public function testPostIndex()
- {
- $falseConfig = new Configuration;
- $falseConfig->data = false;
-
- FireflyConfig::shouldReceive('get')->withArgs(['is_demo_site', false])->once()->andReturn($falseConfig);
- FireflyConfig::shouldReceive('set')->withArgs(['single_user_mode', false])->once();
- FireflyConfig::shouldReceive('set')->withArgs(['is_demo_site', false])->once();
-
- $this->be($this->user());
- $this->call('POST', route('admin.configuration.index.post'));
- $this->assertSessionHas('success');
- $this->assertResponseStatus(302);
- }
-}
diff --git a/tests/acceptance/Controllers/Admin/HomeControllerTest.php b/tests/acceptance/Controllers/Admin/HomeControllerTest.php
deleted file mode 100644
index 8a2ccefb60..0000000000
--- a/tests/acceptance/Controllers/Admin/HomeControllerTest.php
+++ /dev/null
@@ -1,44 +0,0 @@
-be($this->user());
- $this->call('GET', route('admin.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
-}
diff --git a/tests/acceptance/Controllers/Admin/UserControllerTest.php b/tests/acceptance/Controllers/Admin/UserControllerTest.php
deleted file mode 100644
index b5e246bc4d..0000000000
--- a/tests/acceptance/Controllers/Admin/UserControllerTest.php
+++ /dev/null
@@ -1,68 +0,0 @@
-be($this->user());
- $this->call('GET', route('admin.users.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Admin\UserController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('admin.users'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Admin\UserController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('GET', route('admin.users.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
-}
diff --git a/tests/acceptance/Controllers/AttachmentControllerTest.php b/tests/acceptance/Controllers/AttachmentControllerTest.php
deleted file mode 100644
index a2fdbc3d07..0000000000
--- a/tests/acceptance/Controllers/AttachmentControllerTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-be($this->user());
- $this->call('GET', route('attachments.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::destroy
- */
- public function testDestroy()
- {
- $this->session(['attachments.delete.url' => 'http://localhost']);
-
- $repository = $this->mock(AttachmentRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
- $this->be($this->user());
- $this->call('post', route('attachments.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::download
- */
- public function testDownload()
- {
- $repository = $this->mock(AttachmentRepositoryInterface::class);
- $repository->shouldReceive('exists')->once()->andReturn(true);
- $repository->shouldReceive('getContent')->once()->andReturn('This is attachment number one.');
-
- $this->be($this->user());
- $this->call('GET', route('attachments.download', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('This is attachment number one.');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('attachments.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::preview
- */
- public function testPreview()
- {
- $this->be($this->user());
- $this->call('GET', route('attachments.preview', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\AttachmentController::update
- */
- public function testUpdate()
- {
- $this->session(['attachments.edit.url' => 'http://localhost']);
- $data = [
- 'title' => 'Some updated title ' . rand(1000, 9999),
- 'notes' => '',
- 'description' => '',
- ];
-
- $this->be($this->user());
- $this->call('post', route('attachments.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // view should be updated
- $this->be($this->user());
- $this->call('GET', route('attachments.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- $this->see($data['title']);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Auth/LoginControllerTest.php b/tests/acceptance/Controllers/Auth/LoginControllerTest.php
deleted file mode 100644
index 5125dccb98..0000000000
--- a/tests/acceptance/Controllers/Auth/LoginControllerTest.php
+++ /dev/null
@@ -1,64 +0,0 @@
-visit('/login')
- ->type('thegrumpydictator@gmail.com', 'email')
- ->type('james', 'password')
- ->press('Sign In')
- ->seePageIs('/')
- ->see('thegrumpydictator@gmail.com');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Auth\LoginController::logout
- */
- public function testLogout()
- {
- $this->visit('/logout')
- ->seePageIs('/login')
- ->see('Sign in to start your session');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Auth\LoginController::showLoginForm
- */
- public function testShowLoginForm()
- {
- $this->visit('/')
- ->seePageIs('/login')
- ->see('Sign in to start your session');
- }
-}
diff --git a/tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php b/tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php
deleted file mode 100644
index 5661e5823c..0000000000
--- a/tests/acceptance/Controllers/Auth/TwoFactorControllerTest.php
+++ /dev/null
@@ -1,70 +0,0 @@
-be($this->user());
-
- $falsePreference = new Preference;
- $falsePreference->data = true;
- $secretPreference = new Preference;
- $secretPreference->data = 'BlablaSeecret';
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($falsePreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
- $this->call('get', route('two-factor.index'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Auth\TwoFactorController::lostTwoFactor
- */
- public function testLostTwoFactor()
- {
- $this->be($this->user());
-
- $truePreference = new Preference;
- $truePreference->data = true;
- $secretPreference = new Preference;
- $secretPreference->data = 'BlablaSeecret';
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference);
- Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference);
- $this->call('get', route('two-factor.lost'));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/BillControllerTest.php b/tests/acceptance/Controllers/BillControllerTest.php
deleted file mode 100644
index 60a8388697..0000000000
--- a/tests/acceptance/Controllers/BillControllerTest.php
+++ /dev/null
@@ -1,179 +0,0 @@
-be($this->user());
- $this->call('GET', route('bills.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(BillRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->session(['bills.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('bills.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::rescan
- */
- public function testRescan()
- {
- $repository = $this->mock(BillRepositoryInterface::class);
- $repository->shouldReceive('getPossiblyRelatedJournals')->once()->andReturn(new Collection);
- $this->be($this->user());
- $this->call('GET', route('bills.rescan', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('GET', route('bills.show', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::store
- */
- public function testStore()
- {
- $data = [
- 'name' => 'New Bill ' . rand(1000, 9999),
- 'match' => 'some words',
- 'amount_min' => '100',
- 'amount_currency_id_amount_min' => 1,
- 'amount_currency_id_amount_max' => 1,
- 'skip' => 0,
- 'amount_max' => '100',
- 'date' => '2016-01-01',
- 'repeat_freq' => 'monthly',
- ];
- $this->session(['bills.create.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('bills.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list must be updated
- $this->be($this->user());
- $this->call('GET', route('bills.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BillController::update
- */
- public function testUpdate()
- {
- $data = [
- 'name' => 'Updated Bill ' . rand(1000, 9999),
- 'match' => 'some more words',
- 'amount_min' => '100',
- 'amount_currency_id_amount_min' => 1,
- 'amount_currency_id_amount_max' => 1,
- 'skip' => 0,
- 'amount_max' => '100',
- 'date' => '2016-01-01',
- 'repeat_freq' => 'monthly',
- ];
- $this->session(['bills.edit.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('bills.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // list must be updated
- $this->be($this->user());
- $this->call('GET', route('bills.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
-}
diff --git a/tests/acceptance/Controllers/BudgetControllerTest.php b/tests/acceptance/Controllers/BudgetControllerTest.php
deleted file mode 100644
index 25f0f3b91a..0000000000
--- a/tests/acceptance/Controllers/BudgetControllerTest.php
+++ /dev/null
@@ -1,283 +0,0 @@
- 200,
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.amount', [1]), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::create
- */
- public function testCreate()
- {
- $this->be($this->user());
- $this->call('GET', route('budgets.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('budgets.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::destroy
- */
- public function testDestroy()
- {
- $this->session(['budgets.delete.url' => 'http://localhost']);
-
- $repository = $this->mock(BudgetRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('budgets.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('budgets.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::index
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testIndex(string $range)
- {
- $repository = $this->mock(BudgetRepositoryInterface::class);
- $repository->shouldReceive('cleanupBudgets');
- $repository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
- $repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
- $repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::noBudget
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testNoBudget(string $range)
- {
- $date = new Carbon();
- $this->session(['start' => $date, 'end' => clone $date]);
-
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('withoutBudget')->andReturnSelf();
- $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.no-budget'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::postUpdateIncome
- */
- public function testPostUpdateIncome()
- {
- $data = [
- 'amount' => '200',
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.income.post'), $data);
- $this->assertResponseStatus(302);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::show
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShow(string $range)
- {
- $date = new Carbon();
- $date->subDay();
- $this->session(['first' => $date]);
-
- // mock account repository
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);
-
-
- // mock budget repository
- $budgetRepository = $this->mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
- // mock journal collector:
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('setBudget')->andReturnSelf();
- $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::showByBudgetLimit()
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowByBudgetLimit(string $range)
- {
- // mock account repository
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);
-
- // mock budget repository
- $budgetRepository = $this->mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
- $budgetRepository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
-
- // mock journal collector:
- $collector = $this->mock(JournalCollectorInterface::class);
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf();
- $collector->shouldReceive('setRange')->andReturnSelf();
- $collector->shouldReceive('setLimit')->andReturnSelf();
- $collector->shouldReceive('setPage')->andReturnSelf();
- $collector->shouldReceive('setBudget')->andReturnSelf();
- $collector->shouldReceive('withCategoryInformation')->andReturnSelf();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('budgets.show.limit', [1, 1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::store
- */
- public function testStore()
- {
- $this->session(['budgets.create.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'New Budget ' . rand(1000, 9999),
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::update
- */
- public function testUpdate()
- {
- $this->session(['budgets.edit.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'Updated Budget ' . rand(1000, 9999),
- 'active' => 1,
- ];
- $this->be($this->user());
- $this->call('post', route('budgets.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\BudgetController::updateIncome
- */
- public function testUpdateIncome()
- {
- // must be in list
- $this->be($this->user());
- $this->call('GET', route('budgets.income', [1]));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/CategoryControllerTest.php b/tests/acceptance/Controllers/CategoryControllerTest.php
deleted file mode 100644
index da294075d4..0000000000
--- a/tests/acceptance/Controllers/CategoryControllerTest.php
+++ /dev/null
@@ -1,257 +0,0 @@
-be($this->user());
- $this->call('GET', route('categories.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('categories.delete', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::destroy
- */
- public function testDestroy()
- {
- $this->session(['categories.delete.url' => 'http://localhost']);
- $repository = $this->mock(CategoryRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('categories.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('categories.edit', [1]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('categories.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::noCategory
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testNoCategory(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.no-category'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::show
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShow(string $range)
- {
-
- $collector = $this->mock(JournalCollectorInterface::class);
- $accRepository = $this->mock(AccountRepositoryInterface::class);
- $catRepository = $this->mock(CategoryRepositoryInterface::class);
-
- $accRepository->shouldReceive('getAccountsByType')->once()->andReturn(new Collection);
- $catRepository->shouldReceive('firstUseDate')->once()->andReturn(new Carbon);
-
- // collector stuff:
- $collector->shouldReceive('setPage')->andReturnSelf()->once();
- $collector->shouldReceive('setLimit')->andReturnSelf()->once();
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
- $collector->shouldReceive('setRange')->andReturnSelf()->once();
- $collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
- $collector->shouldReceive('setCategory')->andReturnSelf()->once();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
-
- // more repos stuff:
- $catRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $catRepository->shouldReceive('earnedInPeriod')->andReturn('0');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::showAll
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowAll(string $range)
- {
- $collector = $this->mock(JournalCollectorInterface::class);
-
- // collector stuff:
- $collector->shouldReceive('setPage')->andReturnSelf()->once();
- $collector->shouldReceive('setLimit')->andReturnSelf()->once();
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
- $collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
- $collector->shouldReceive('setCategory')->andReturnSelf()->once();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.show.all', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::showByDate
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testShowByDate(string $range)
- {
- $collector = $this->mock(JournalCollectorInterface::class);
-
- // collector stuff:
- $collector->shouldReceive('setPage')->andReturnSelf()->once();
- $collector->shouldReceive('setLimit')->andReturnSelf()->once();
- $collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->once();
- $collector->shouldReceive('setRange')->andReturnSelf()->once();
- $collector->shouldReceive('withBudgetInformation')->andReturnSelf()->once();
- $collector->shouldReceive('setCategory')->andReturnSelf()->once();
- $collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
-
- // mock category repository
- $repository = $this->mock(CategoryRepositoryInterface::class);
- $repository->shouldReceive('firstUseDate')->once()->andReturn(new Carbon);
- $repository->shouldReceive('spentInPeriod')->andReturn('-1');
- $repository->shouldReceive('earnedInPeriod')->andReturn('1');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('categories.show.date', [1, '2015-01-01']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::store
- */
- public function testStore()
- {
- $this->session(['categories.create.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'New Category ' . rand(1000, 9999),
- ];
- $this->be($this->user());
- $this->call('post', route('categories.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // must be in list
- $this->be($this->user());
- $this->call('GET', route('categories.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CategoryController::update
- */
- public function testUpdate()
- {
- $this->session(['categories.edit.url' => 'http://localhost']);
-
- $data = [
- 'name' => 'Updated Category ' . rand(1000, 9999),
- 'active' => 1,
- ];
- $this->be($this->user());
- $this->call('post', route('categories.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // must be in list
- $this->be($this->user());
- $this->call('GET', route('categories.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- $this->see($data['name']);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/AccountControllerTest.php b/tests/acceptance/Controllers/Chart/AccountControllerTest.php
deleted file mode 100644
index ab19fe167b..0000000000
--- a/tests/acceptance/Controllers/Chart/AccountControllerTest.php
+++ /dev/null
@@ -1,154 +0,0 @@
-be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.expense'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseBudget
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testExpenseBudget(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.expense-budget', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::expenseCategory
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testExpenseCategory(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.expense-category', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::frontpage
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testFrontpage(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.frontpage'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::incomeCategory
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testIncomeCategory(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.income-category', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::period
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testPeriod(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.period', [1, '2012-01-01']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::report
- */
- public function testReport()
- {
- $this->be($this->user());
- $this->call('get', route('chart.account.report', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::revenueAccounts
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testRevenueAccounts(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.revenue'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\AccountController::single
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testSingle(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.account.single', [1]));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/BillControllerTest.php b/tests/acceptance/Controllers/Chart/BillControllerTest.php
deleted file mode 100644
index 657c934f28..0000000000
--- a/tests/acceptance/Controllers/Chart/BillControllerTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.bill.frontpage'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BillController::single
- */
- public function testSingle()
- {
- $this->be($this->user());
- $this->call('get', route('chart.bill.single', [1]));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/BudgetControllerTest.php b/tests/acceptance/Controllers/Chart/BudgetControllerTest.php
deleted file mode 100644
index dd9b49586b..0000000000
--- a/tests/acceptance/Controllers/Chart/BudgetControllerTest.php
+++ /dev/null
@@ -1,103 +0,0 @@
-mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('firstUseDate')->andReturn(new Carbon('2015-01-01'));
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('-100');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.budget.budget', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budgetLimit
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testBudgetLimit(string $range)
- {
- $budgetRepository = $this->mock(BudgetRepositoryInterface::class);
- $budgetRepository->shouldReceive('spentInPeriod')->andReturn('-100');
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.budget.budget-limit', [1,1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::frontpage
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testFrontpage(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.budget.frontpage'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::period
- */
- public function testPeriod()
- {
- $this->be($this->user());
- $this->call('get', route('chart.budget.period', [1,'1','20120101','20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\BudgetController::periodNoBudget
- */
- public function testPeriodNoBudget()
- {
- $this->be($this->user());
- $this->call('get', route('chart.budget.period.no-budget', ['1','20120101','20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Chart/CategoryControllerTest.php b/tests/acceptance/Controllers/Chart/CategoryControllerTest.php
deleted file mode 100644
index 06af5d366c..0000000000
--- a/tests/acceptance/Controllers/Chart/CategoryControllerTest.php
+++ /dev/null
@@ -1,148 +0,0 @@
-mock(CategoryRepositoryInterface::class);
-
- $catRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $catRepository->shouldReceive('earnedInPeriod')->andReturn('0');
- $catRepository->shouldReceive('firstUseDate')->andReturn(new Carbon);
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.all', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::currentPeriod
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::makePeriodChart
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testCurrentPeriod(string $range)
- {
- // this is actually for makePeriodChart
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $categoryRepository = $this->mock(CategoryRepositoryInterface::class);
- $account = $this->user()->accounts()->where('account_type_id', 5)->first();
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- $categoryRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $categoryRepository->shouldReceive('earnedInPeriod')->andReturn('0');
-
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.current', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::frontpage
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testFrontpage(string $range)
- {
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $categoryRepository = $this->mock(CategoryRepositoryInterface::class);
- $category = $this->user()->categories()->first();
- $account = $this->user()->accounts()->where('account_type_id', 5)->first();
- // get one category
- $categoryRepository->shouldReceive('getCategories')->andReturn(new Collection([$category]));
- // get one account
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- // always return zero
- $categoryRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $categoryRepository->shouldReceive('spentInPeriodWithoutCategory')->andReturn('0');
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.frontpage', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::reportPeriod
- */
- public function testReportPeriod()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.period', [1, '1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::reportPeriodNoCategory
- */
- public function testReportPeriodNoCategory()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.period.no-category', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::specificPeriod
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryController::makePeriodChart
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testSpecificPeriod(string $range)
- {
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $categoryRepository = $this->mock(CategoryRepositoryInterface::class);
- $account = $this->user()->accounts()->where('account_type_id', 5)->first();
- $accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection([$account]));
- $categoryRepository->shouldReceive('spentInPeriod')->andReturn('0');
- $categoryRepository->shouldReceive('earnedInPeriod')->andReturn('0');
-
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('get', route('chart.category.specific', ['1', '2012-01-01']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php b/tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php
deleted file mode 100644
index ba948c67ae..0000000000
--- a/tests/acceptance/Controllers/Chart/CategoryReportControllerTest.php
+++ /dev/null
@@ -1,82 +0,0 @@
-be($this->user());
- $this->call('get', route('chart.category.account-expense', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountIncome
- */
- public function testAccountIncome()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.account-income', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::categoryExpense
- */
- public function testCategoryExpense()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.category-expense', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::categoryIncome
- */
- public function testCategoryIncome()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.category-income', ['1', '1', '20120101', '20120131', 0]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::mainChart
- */
- public function testMainChart()
- {
- $this->be($this->user());
- $this->call('get', route('chart.category.main', ['1', '1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php b/tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php
deleted file mode 100644
index f368213e00..0000000000
--- a/tests/acceptance/Controllers/Chart/PiggyBankControllerTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-be($this->user());
- $this->call('get', route('chart.piggy-bank.history', [1]));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Chart/ReportControllerTest.php b/tests/acceptance/Controllers/Chart/ReportControllerTest.php
deleted file mode 100644
index 7b782367bc..0000000000
--- a/tests/acceptance/Controllers/Chart/ReportControllerTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-be($this->user());
- $this->call('get', route('chart.report.net-worth', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\ReportController::operations
- */
- public function testOperations()
- {
- $this->be($this->user());
- $this->call('get', route('chart.report.operations', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Chart\ReportController::sum
- */
- public function testSum()
- {
- $this->be($this->user());
- $this->call('get', route('chart.report.sum', [1, '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/CurrencyControllerTest.php b/tests/acceptance/Controllers/CurrencyControllerTest.php
deleted file mode 100644
index 36d14bacde..0000000000
--- a/tests/acceptance/Controllers/CurrencyControllerTest.php
+++ /dev/null
@@ -1,140 +0,0 @@
-be($this->user());
- $this->call('GET', route('currencies.create'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::defaultCurrency
- */
- public function testDefaultCurrency()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.default', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.delete', [2]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::destroy
- */
- public function testDestroy()
- {
- $this->session(['currencies.delete.url' => 'http://localhost']);
- $repository = $this->mock(CurrencyRepositoryInterface::class);
- $repository->shouldReceive('canDeleteCurrency')->andReturn(true);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->be($this->user());
- $this->call('post', route('currencies.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.edit', [2]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('currencies.index'));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::store
- */
- public function testStore()
- {
- $this->session(['currencies.create.url' => 'http://localhost']);
- $data = [
- 'name' => 'XX',
- 'code' => 'XXX',
- 'symbol' => 'x',
- 'decimal_places' => 2,
- ];
- $this->be($this->user());
- $this->call('post', route('currencies.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\CurrencyController::update
- */
- public function testUpdate()
- {
- $this->session(['currencies.edit.url' => 'http://localhost']);
- $data = [
- 'name' => 'XA',
- 'code' => 'XAX',
- 'symbol' => 'a',
- 'decimal_places' => 2,
- ];
- $this->be($this->user());
- $this->call('post', route('currencies.update', [2]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/ExportControllerTest.php b/tests/acceptance/Controllers/ExportControllerTest.php
deleted file mode 100644
index 39a7bd4ebc..0000000000
--- a/tests/acceptance/Controllers/ExportControllerTest.php
+++ /dev/null
@@ -1,111 +0,0 @@
-mock(ExportJobRepositoryInterface::class);
- $repository->shouldReceive('exists')->once()->andReturn(true);
- $repository->shouldReceive('getContent')->once()->andReturn('Some content beep boop');
-
- $this->be($this->user());
- $this->call('GET', route('export.download', ['testExport']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ExportController::getStatus
- */
- public function testGetStatus()
- {
- $this->be($this->user());
- $this->call('GET', route('export.status', ['testExport']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ExportController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('export.index'));
- $this->assertResponseStatus(200);
-
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ExportController::postIndex
- */
- public function testPostIndex()
- {
- $this->session(
- ['first' => new Carbon('2014-01-01')]
- );
-
-
- $data = [
-
- 'export_start_range' => '2015-01-01',
- 'export_end_range' => '2015-01-21',
- 'exportFormat' => 'csv',
- 'accounts' => [1],
- 'job' => 'testExport',
- ];
-
- $accountRepository = $this->mock(AccountRepositoryInterface::class);
- $accountRepository->shouldReceive('getAccountsById')->withArgs([$data['accounts']])->andReturn(new Collection);
-
- $processor = $this->mock(ProcessorInterface::class);
- $processor->shouldReceive('collectJournals')->once();
- $processor->shouldReceive('convertJournals')->once();
- $processor->shouldReceive('exportJournals')->once();
- $processor->shouldReceive('createZipFile')->once();
-
- $repository = $this->mock(ExportJobRepositoryInterface::class);
- $repository->shouldReceive('changeStatus')->andReturn(true);
- $repository->shouldReceive('findByKey')->andReturn(new ExportJob);
-
- $this->be($this->user());
-
- $this->call('post', route('export.export'), $data);
- $this->assertResponseStatus(200);
- $this->see('ok');
- }
-
-}
diff --git a/tests/acceptance/Controllers/HelpControllerTest.php b/tests/acceptance/Controllers/HelpControllerTest.php
deleted file mode 100644
index 9acadb6482..0000000000
--- a/tests/acceptance/Controllers/HelpControllerTest.php
+++ /dev/null
@@ -1,45 +0,0 @@
-mock(HelpInterface::class);
- $help->shouldReceive('hasRoute')->andReturn(true)->once();
- $help->shouldReceive('inCache')->andReturn(false)->once();
- $help->shouldReceive('getFromGithub')->andReturn('Help content here.')->once();
- $help->shouldReceive('putInCache')->once();
-
- $this->be($this->user());
- $this->call('GET', route('help.show', ['index']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/HomeControllerTest.php b/tests/acceptance/Controllers/HomeControllerTest.php
deleted file mode 100644
index 5babd78d5c..0000000000
--- a/tests/acceptance/Controllers/HomeControllerTest.php
+++ /dev/null
@@ -1,96 +0,0 @@
-be($this->user());
-
- $args = [
- 'start' => '2012-01-01',
- 'end' => '2012-04-01',
- ];
-
- $this->call('POST', route('daterange'), $args);
- $this->assertResponseStatus(200);
- $this->assertSessionHas('warning', '91 days of data may take a while to load.');
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::displayError
- */
- public function testDisplayError()
- {
- $this->be($this->user());
- $this->call('GET', route('error'));
- $this->assertResponseStatus(500);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::flush
- */
- public function testFlush()
- {
- $this->be($this->user());
- $this->call('GET', route('flush'));
- $this->assertResponseStatus(302);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::index
- * @covers FireflyIII\Http\Controllers\Controller::__construct
- * @dataProvider dateRangeProvider
- *
- * @param $range
- */
- public function testIndex(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('index'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::routes
- * @dataProvider dateRangeProvider
- *
- * @param string $range
- */
- public function testRoutes(string $range)
- {
- $this->be($this->user());
- $this->changeDateRange($this->user(), $range);
- $this->call('GET', route('all-routes'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers FireflyIII\Http\Controllers\HomeController::testFlash
- */
- public function testTestFlash()
- {
- $this->be($this->user());
- $this->call('GET', route('test-flash'));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertSessionHas('info');
- $this->assertSessionHas('warning');
- $this->assertSessionHas('error');
- }
-}
diff --git a/tests/acceptance/Controllers/ImportControllerTest.php b/tests/acceptance/Controllers/ImportControllerTest.php
deleted file mode 100644
index 4c4c4dda3d..0000000000
--- a/tests/acceptance/Controllers/ImportControllerTest.php
+++ /dev/null
@@ -1,177 +0,0 @@
-be($this->user());
- $this->call('GET', route('import.complete', ['complete']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::configure
- */
- public function testConfigure()
- {
- $this->be($this->user());
- $this->call('GET', route('import.configure', ['configure']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::download
- */
- public function testDownload()
- {
- $this->be($this->user());
- $this->call('GET', route('import.download', ['configure']));
- $this->assertResponseStatus(200);
- $this->see('[]');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::finished
- */
- public function testFinished()
- {
- $this->be($this->user());
- $this->call('GET', route('import.finished', ['finished']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('import.index'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::json
- */
- public function testJson()
- {
- $this->be($this->user());
- $this->call('GET', route('import.json', ['configure']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::postConfigure
- */
- public function testPostConfigure()
- {
- $importer = $this->mock(CsvSetup::class);
- $importer->shouldReceive('setJob')->once();
- $importer->shouldReceive('saveImportConfiguration')->once();
-
- $data = [];
- $this->be($this->user());
- $this->call('post', route('import.process-configuration', ['p-configure']), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('import.settings', ['p-configure']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::postSettings
- */
- public function testPostSettings()
- {
- $importer = $this->mock(CsvSetup::class);
- $importer->shouldReceive('setJob')->once();
- $importer->shouldReceive('storeSettings')->once();
- $data = [];
- $this->be($this->user());
- $this->call('post', route('import.post-settings', ['p-settings']), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('import.settings', ['p-settings']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::settings
- */
- public function testSettings()
- {
- $importer = $this->mock(CsvSetup::class);
- $importer->shouldReceive('setJob')->once();
- $importer->shouldReceive('requireUserSettings')->once()->andReturn(false);
- $this->be($this->user());
- $this->call('get', route('import.settings', ['settings']));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('import.complete', ['settings']);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::start
- */
- public function testStart()
- {
- /** @var ImportProcedureInterface $procedure */
- $procedure = $this->mock(ImportProcedureInterface::class);
-
- $procedure->shouldReceive('runImport');
-
- $this->be($this->user());
- $this->call('post', route('import.start', ['complete']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::status
- * Implement testStatus().
- */
- public function testStatus()
- {
- // complete
- $this->be($this->user());
- $this->call('get', route('import.status', ['complete']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ImportController::upload
- */
- public function testUpload()
- {
- $path = resource_path('stubs/csv.csv');
- $file = new UploadedFile($path, 'upload.csv', filesize($path), 'text/csv', null, true);
- $this->call('POST', route('import.upload'), [], [], ['import_file' => $file], ['Accept' => 'application/json']);
- $this->assertResponseStatus(302);
- }
-}
diff --git a/tests/acceptance/Controllers/JsonControllerTest.php b/tests/acceptance/Controllers/JsonControllerTest.php
deleted file mode 100644
index bcd30afada..0000000000
--- a/tests/acceptance/Controllers/JsonControllerTest.php
+++ /dev/null
@@ -1,158 +0,0 @@
-be($this->user());
- $this->call('get', route('json.action'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxBillsPaid
- */
- public function testBoxBillsPaid()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.paid'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxBillsUnpaid
- */
- public function testBoxBillsUnpaid()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.unpaid'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxIn
- */
- public function testBoxIn()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.in'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::boxOut
- */
- public function testBoxOut()
- {
- $this->be($this->user());
- $this->call('get', route('json.box.out'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::categories
- */
- public function testCategories()
- {
- $this->be($this->user());
- $this->call('get', route('json.categories'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::endTour
- */
- public function testEndTour()
- {
- $this->be($this->user());
- $this->call('post', route('json.end-tour'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::expenseAccounts
- */
- public function testExpenseAccounts()
- {
- $this->be($this->user());
- $this->call('get', route('json.expense-accounts'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::revenueAccounts
- */
- public function testRevenueAccounts()
- {
- $this->be($this->user());
- $this->call('get', route('json.revenue-accounts'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::tags
- */
- public function testTags()
- {
- $this->be($this->user());
- $this->call('get', route('json.tags'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::tour
- */
- public function testTour()
- {
- $this->be($this->user());
- $this->call('get', route('json.tour'));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::transactionJournals
- */
- public function testTransactionJournals()
- {
- $this->be($this->user());
- $this->call('get', route('json.transaction-journals', ['deposit']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\JsonController::trigger
- */
- public function testTrigger()
- {
- $this->be($this->user());
- $this->call('get', route('json.trigger'));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/NewUserControllerTest.php b/tests/acceptance/Controllers/NewUserControllerTest.php
deleted file mode 100644
index 7c98ec5583..0000000000
--- a/tests/acceptance/Controllers/NewUserControllerTest.php
+++ /dev/null
@@ -1,55 +0,0 @@
-be($this->emptyUser());
- $this->call('get', route('new-user.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\NewUserController::submit
- */
- public function testSubmit()
- {
- $data = [
- 'bank_name' => 'New bank',
- 'bank_balance' => 100,
- ];
- $this->be($this->emptyUser());
- $this->call('post', route('new-user.submit'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
-}
diff --git a/tests/acceptance/Controllers/PiggyBankControllerTest.php b/tests/acceptance/Controllers/PiggyBankControllerTest.php
deleted file mode 100644
index d480600d21..0000000000
--- a/tests/acceptance/Controllers/PiggyBankControllerTest.php
+++ /dev/null
@@ -1,241 +0,0 @@
-be($this->user());
- $this->call('get', route('piggy-banks.add', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::addMobile
- */
- public function testAddMobile()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.add-money-mobile', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::create
- */
- public function testCreate()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.create'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(PiggyBankRepositoryInterface::class);
- $repository->shouldReceive('destroy')->andReturn(true);
-
- $this->session(['piggy-banks.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('piggy-banks.destroy', [2]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::order
- */
- public function testOrder()
- {
- $this->be($this->user());
- $this->call('post', route('piggy-banks.order', [1, 2]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::postAdd
- */
- public function testPostAdd()
- {
- $data = ['amount' => '1.123'];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.add', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('piggy-banks.index');
- $this->assertSessionHas('success');
- }
-
- /**
- * Add the exact amount to fill a piggy bank
- *
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::postAdd
- */
- public function testPostAddExact()
- {
- // find a piggy with current amount = 0.
- $piggy = PiggyBank::leftJoin('piggy_bank_repetitions', 'piggy_bank_repetitions.piggy_bank_id', '=', 'piggy_banks.id')
- ->where('currentamount', 0)
- ->first(['piggy_banks.id', 'targetamount']);
-
-
- $data = ['amount' => strval($piggy->targetamount)];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.add', [$piggy->id]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('piggy-banks.index');
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::postRemove
- */
- public function testPostRemove()
- {
- $data = ['amount' => '1.123'];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.remove', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('piggy-banks.index');
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::remove
- */
- public function testRemove()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.remove', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::removeMobile
- */
- public function testRemoveMobile()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.remove-money-mobile', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('get', route('piggy-banks.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::store
- */
- public function testStore()
- {
- $this->session(['piggy-banks.create.url' => 'http://localhost']);
- $data = [
- 'name' => 'Piggy ' . rand(999, 10000),
- 'targetamount' => '100.123',
- 'account_id' => 2,
- 'amount_currency_id_targetamount' => 1,
-
- ];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PiggyBankController::update
- */
- public function testUpdate()
- {
- $this->session(['piggy-banks.edit.url' => 'http://localhost']);
- $data = [
- 'name' => 'Updated Piggy ' . rand(999, 10000),
- 'targetamount' => '100.123',
- 'account_id' => 2,
- 'amount_currency_id_targetamount' => 1,
-
- ];
- $this->be($this->user());
- $this->call('post', route('piggy-banks.update', [3]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
-}
diff --git a/tests/acceptance/Controllers/Popup/ReportControllerTest.php b/tests/acceptance/Controllers/Popup/ReportControllerTest.php
deleted file mode 100644
index e601cc167e..0000000000
--- a/tests/acceptance/Controllers/Popup/ReportControllerTest.php
+++ /dev/null
@@ -1,149 +0,0 @@
-be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'balance-amount',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- 'role' => 3, // diff role, is complicated.
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testBudgetSpentAmount()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'budget-spent-amount',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testCategoryEntry()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'category-entry',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testExpenseEntry()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'expense-entry',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
- */
- public function testIncomeEntry()
- {
-
- $this->be($this->user());
- $arguments = [
- 'attributes' => [
- 'location' => 'income-entry',
- 'startDate' => Carbon::now()->startOfMonth()->format('Ymd'),
- 'endDate' => Carbon::now()->endOfMonth()->format('Ymd'),
- 'accounts' => 1,
- 'accountId' => 1,
- 'categoryId' => 1,
- 'budgetId' => 1,
- ],
- ];
- $uri = route('popup.general') . '?' . http_build_query($arguments);
- $this->call('get', $uri);
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/PreferencesControllerTest.php b/tests/acceptance/Controllers/PreferencesControllerTest.php
deleted file mode 100644
index 782453bd0d..0000000000
--- a/tests/acceptance/Controllers/PreferencesControllerTest.php
+++ /dev/null
@@ -1,87 +0,0 @@
-be($this->user());
- $this->call('get', route('preferences.code'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PreferencesController::deleteCode
- */
- public function testDeleteCode()
- {
- $this->be($this->user());
- $this->call('get', route('preferences.delete-code'));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertSessionHas('info');
- $this->assertRedirectedToRoute('preferences.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PreferencesController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('preferences.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\PreferencesController::postIndex
- */
- public function testPostIndex()
- {
- $data = [
- 'fiscalYearStart' => '2016-01-01',
- 'frontPageAccounts' => [],
- 'viewRange' => '1M',
- 'customFiscalYear' => 0,
- 'showDepositsFrontpage' => 0,
- 'transactionPageSize' => 100,
- 'twoFactorAuthEnabled' => 0,
- 'language' => 'en_US',
- 'tj' => [],
- ];
-
- $this->be($this->user());
- $this->call('post', route('preferences.update'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('preferences.index');
- }
-}
diff --git a/tests/acceptance/Controllers/ProfileControllerTest.php b/tests/acceptance/Controllers/ProfileControllerTest.php
deleted file mode 100644
index f11a4556a0..0000000000
--- a/tests/acceptance/Controllers/ProfileControllerTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-be($this->user());
- $this->call('get', route('profile.change-password'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::deleteAccount
- */
- public function testDeleteAccount()
- {
- $this->be($this->user());
- $this->call('get', route('profile.delete-account'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('profile.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::postChangePassword
- */
- public function testPostChangePassword()
- {
- $repository = $this->mock(UserRepositoryInterface::class);
- $repository->shouldReceive('changePassword');
-
- $data = [
- 'current_password' => 'james',
- 'new_password' => 'james2',
- 'new_password_confirmation' => 'james2',
- ];
- $this->be($this->user());
- $this->call('post', route('profile.change-password.post'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ProfileController::postDeleteAccount
- */
- public function testPostDeleteAccount()
- {
- $repository = $this->mock(UserRepositoryInterface::class);
- $repository->shouldReceive('destroy');
- $data = [
- 'password' => 'james',
- ];
- $this->be($this->user());
- $this->call('post', route('profile.delete-account.post'), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('index');
- }
-}
diff --git a/tests/acceptance/Controllers/Report/AccountControllerTest.php b/tests/acceptance/Controllers/Report/AccountControllerTest.php
deleted file mode 100644
index 40a1968bcf..0000000000
--- a/tests/acceptance/Controllers/Report/AccountControllerTest.php
+++ /dev/null
@@ -1,42 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.account.general', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/Report/BalanceControllerTest.php b/tests/acceptance/Controllers/Report/BalanceControllerTest.php
deleted file mode 100644
index aadfa39ec7..0000000000
--- a/tests/acceptance/Controllers/Report/BalanceControllerTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.balance.general', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Report/BudgetControllerTest.php b/tests/acceptance/Controllers/Report/BudgetControllerTest.php
deleted file mode 100644
index e13c2bf47c..0000000000
--- a/tests/acceptance/Controllers/Report/BudgetControllerTest.php
+++ /dev/null
@@ -1,51 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.budget.general', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\BudgetController::period
- */
- public function testPeriod()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.budget.period', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Report/CategoryControllerTest.php b/tests/acceptance/Controllers/Report/CategoryControllerTest.php
deleted file mode 100644
index 44f12f599d..0000000000
--- a/tests/acceptance/Controllers/Report/CategoryControllerTest.php
+++ /dev/null
@@ -1,61 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.category.expenses', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\CategoryController::income
- */
- public function testIncome()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.category.income', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\CategoryController::operations
- */
- public function testOperations()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.category.operations', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-}
diff --git a/tests/acceptance/Controllers/Report/OperationsControllerTest.php b/tests/acceptance/Controllers/Report/OperationsControllerTest.php
deleted file mode 100644
index 027bc2a0e9..0000000000
--- a/tests/acceptance/Controllers/Report/OperationsControllerTest.php
+++ /dev/null
@@ -1,62 +0,0 @@
-be($this->user());
- $this->call('get', route('report-data.operations.expenses', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\OperationsController::income
- */
- public function testIncome()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.operations.income', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Report\OperationsController::operations
- */
- public function testOperations()
- {
- $this->be($this->user());
- $this->call('get', route('report-data.operations.operations', ['1', '20120101', '20120131']));
- $this->assertResponseStatus(200);
- }
-
-}
diff --git a/tests/acceptance/Controllers/ReportControllerTest.php b/tests/acceptance/Controllers/ReportControllerTest.php
deleted file mode 100644
index d975bb4581..0000000000
--- a/tests/acceptance/Controllers/ReportControllerTest.php
+++ /dev/null
@@ -1,105 +0,0 @@
-be($this->user());
- $this->call('get', route('reports.report.audit', [1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::budgetReport
- */
- public function testBudgetReport()
- {
- $this->be($this->user());
- $this->call('get', route('reports.report.budget', [1, 1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::categoryReport
- */
- public function testCategoryReport()
- {
- $this->be($this->user());
- $this->call('get', route('reports.report.category', [1, 1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::defaultReport
- */
- public function testDefaultReport()
- {
- $this->be($this->user());
- $this->call('get', route('reports.report.default', [1, '20160101', '20160131']));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('reports.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::options
- */
- public function testOptions()
- {
- $this->be($this->user());
- $this->call('get', route('reports.options', ['default']));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\ReportController::postIndex
- */
- public function testPostIndex()
- {
- $this->be($this->user());
- $this->call('post', route('reports.index.post'));
- $this->assertResponseStatus(302);
- }
-}
diff --git a/tests/acceptance/Controllers/RuleControllerTest.php b/tests/acceptance/Controllers/RuleControllerTest.php
deleted file mode 100644
index 41ad37571c..0000000000
--- a/tests/acceptance/Controllers/RuleControllerTest.php
+++ /dev/null
@@ -1,228 +0,0 @@
-be($this->user());
- $this->call('get', route('rules.create', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('rules.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('destroy');
-
- $this->session(['rules.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('rules.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::down
- */
- public function testDown()
- {
- $this->be($this->user());
- $this->call('get', route('rules.down', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('rules.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('get', route('rules.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::reorderRuleActions
- */
- public function testReorderRuleActions()
- {
- $data = [
- 'triggers' => [1, 2, 3],
- ];
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('reorderRuleActions');
-
- $this->be($this->user());
- $this->call('post', route('rules.reorder-actions', [1]), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::reorderRuleTriggers
- */
- public function testReorderRuleTriggers()
- {
- $data = [
- 'triggers' => [1, 2, 3],
- ];
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('reorderRuleTriggers');
-
- $this->be($this->user());
- $this->call('post', route('rules.reorder-triggers', [1]), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::store
- */
- public function testStore()
- {
- $this->session(['rules.create.url' => 'http://localhost']);
- $data = [
- 'rule_group_id' => 1,
- 'active' => 1,
- 'title' => 'A',
- 'trigger' => 'store-journal',
- 'description' => 'D',
- 'rule-trigger' => [
- 1 => 'from_account_starts',
- ],
- 'rule-trigger-value' => [
- 1 => 'B',
- ],
- 'rule-action' => [
- 1 => 'set_category',
- ],
- 'rule-action-value' => [
- 1 => 'C',
- ],
- ];
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('store')->andReturn(new Rule);
-
- $this->be($this->user());
- $this->call('post', route('rules.store', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * This actually hits an error and not the actually code but OK.
- *
- * @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
- */
- public function testTestTriggers()
- {
- $this->be($this->user());
- $this->call('get', route('rules.test-triggers', [1]));
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::up
- */
- public function testUp()
- {
- $this->be($this->user());
- $this->call('get', route('rules.up', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleController::update
- */
- public function testUpdate()
- {
- $data = [
- 'rule_group_id' => 1,
- 'title' => 'Your first default rule',
- 'trigger' => 'store-journal',
- 'active' => 1,
- 'description' => 'This rule is an example. You can safely delete it.',
- 'rule-trigger' => [
- 1 => 'description_is',
- ],
- 'rule-trigger-value' => [
- 1 => 'something',
- ],
- 'rule-action' => [
- 1 => 'prepend_description',
- ],
- 'rule-action-value' => [
- 1 => 'Bla bla',
- ],
- ];
- $this->session(['rules.edit.url' => 'http://localhost']);
-
- $repository = $this->mock(RuleRepositoryInterface::class);
- $repository->shouldReceive('update');
-
- $this->be($this->user());
- $this->call('post', route('rules.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/RuleGroupControllerTest.php b/tests/acceptance/Controllers/RuleGroupControllerTest.php
deleted file mode 100644
index b61a95409e..0000000000
--- a/tests/acceptance/Controllers/RuleGroupControllerTest.php
+++ /dev/null
@@ -1,173 +0,0 @@
-be($this->user());
- $this->call('get', route('rule-groups.create'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(RuleGroupRepositoryInterface::class);
- $repository->shouldReceive('destroy');
-
- $this->session(['rule-groups.delete.url' => 'http://localhost']);
- $this->be($this->user());
- $this->call('post', route('rule-groups.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::down
- */
- public function testDown()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.down', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::execute
- */
- public function testExecute()
- {
- $this->session(['first' => new Carbon('2010-01-01')]);
- $data = [
- 'accounts' => [1],
- 'start_date' => '2010-01-02',
- 'end_date' => '2010-01-02',
- ];
- $this->be($this->user());
- $this->call('post', route('rule-groups.execute', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::selectTransactions
- */
- public function testSelectTransactions()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.select-transactions', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::store
- */
- public function testStore()
- {
- $this->session(['rule-groups.create.url' => 'http://localhost']);
- $data = [
- 'title' => 'A',
- 'description' => '',
- ];
-
- $repository = $this->mock(RuleGroupRepositoryInterface::class);
- $repository->shouldReceive('store')->andReturn(new RuleGroup);
- $repository->shouldReceive('find')->andReturn(new RuleGroup);
-
- $this->be($this->user());
- $this->call('post', route('rule-groups.store', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::up
- */
- public function testUp()
- {
- $this->be($this->user());
- $this->call('get', route('rule-groups.up', [1]));
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('rules.index');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\RuleGroupController::update
- */
- public function testUpdate()
- {
- $data = [
- 'title' => 'C',
- 'description' => 'XX',
- ];
- $this->session(['rule-groups.edit.url' => 'http://localhost']);
-
- $repository = $this->mock(RuleGroupRepositoryInterface::class);
- $repository->shouldReceive('update');
- $repository->shouldReceive('find')->andReturn(new RuleGroup);
-
- $this->be($this->user());
- $this->call('post', route('rule-groups.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/SearchControllerTest.php b/tests/acceptance/Controllers/SearchControllerTest.php
deleted file mode 100644
index 68b1b97636..0000000000
--- a/tests/acceptance/Controllers/SearchControllerTest.php
+++ /dev/null
@@ -1,49 +0,0 @@
-mock(SearchInterface::class);
- $search->shouldReceive('setLimit')->once();
- $search->shouldReceive('searchTransactions')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchBudgets')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchTags')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchCategories')->andReturn(new Collection)->withArgs([['test']])->once();
- $search->shouldReceive('searchAccounts')->andReturn(new Collection)->withArgs([['test']])->once();
- $this->be($this->user());
- $this->call('get', route('search.index') . '?q=test');
- $this->assertResponseStatus(200);
- $this->see('');
- }
-}
diff --git a/tests/acceptance/Controllers/TagControllerTest.php b/tests/acceptance/Controllers/TagControllerTest.php
deleted file mode 100644
index 4a7717d528..0000000000
--- a/tests/acceptance/Controllers/TagControllerTest.php
+++ /dev/null
@@ -1,135 +0,0 @@
-be($this->user());
- $this->call('GET', route('tags.create'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.delete', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::destroy
- */
- public function testDestroy()
- {
- $repository = $this->mock(TagRepositoryInterface::class);
- $repository->shouldReceive('destroy');
-
- $this->be($this->user());
- $this->call('post', route('tags.destroy', [1]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.edit', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::index
- */
- public function testIndex()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.index'));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('GET', route('tags.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::store
- */
- public function testStore()
- {
- $this->session(['tags.create.url' => 'http://localhost']);
- $data = [
- 'tag' => 'Hello new tag' . rand(999, 10000),
- 'tagMode' => 'nothing',
- ];
- $this->be($this->user());
- $this->call('post', route('tags.store'), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TagController::update
- */
- public function testUpdate()
- {
- $this->session(['tags.edit.url' => 'http://localhost']);
- $data = [
- 'tag' => 'Hello updated tag' . rand(999, 10000),
- 'tagMode' => 'nothing',
- ];
- $repository = $this->mock(TagRepositoryInterface::class);
- $repository->shouldReceive('update');
- $repository->shouldReceive('find')->andReturn(new Tag);
-
- $this->be($this->user());
- $this->call('post', route('tags.update', [1]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-}
diff --git a/tests/acceptance/Controllers/Transaction/ConvertControllerTest.php b/tests/acceptance/Controllers/Transaction/ConvertControllerTest.php
deleted file mode 100644
index deab21f8d7..0000000000
--- a/tests/acceptance/Controllers/Transaction/ConvertControllerTest.php
+++ /dev/null
@@ -1,121 +0,0 @@
-where('user_id', $this->user()->id)->first();
-
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['transfer', $deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a deposit into a transfer');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexDepositWithdrawal()
- {
- $deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['withdrawal', $deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a deposit into a withdrawal');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexTransferDeposit()
- {
- $transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['deposit', $transfer->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a transfer into a deposit');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexTransferWithdrawal()
- {
- $transfer = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['withdrawal', $transfer->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a transfer into a withdrawal');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexWithdrawalDeposit()
- {
- $withdrawal= TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['deposit', $withdrawal->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a withdrawal into a deposit');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::index
- */
- public function testIndexWithdrawalTransfer()
- {
- $withdrawal= TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.convert.index', ['transfer', $withdrawal->id]));
- $this->assertResponseStatus(200);
- $this->see('Convert a withdrawal into a transfer');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\ConvertController::postIndex
- */
- public function testPostIndex()
- {
- $withdrawal= TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
- // convert a withdrawal to a transfer. Requires the ID of another asset account.
- $data = [
- 'destination_account_asset' => 2,
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.convert.index', ['transfer', $withdrawal->id]), $data);
- $this->assertResponseStatus(302);
- $this->assertRedirectedToRoute('transactions.show', [$withdrawal->id]);
- }
-}
diff --git a/tests/acceptance/Controllers/Transaction/MassControllerTest.php b/tests/acceptance/Controllers/Transaction/MassControllerTest.php
deleted file mode 100644
index e6bf99179e..0000000000
--- a/tests/acceptance/Controllers/Transaction/MassControllerTest.php
+++ /dev/null
@@ -1,115 +0,0 @@
-where('user_id', $this->user()->id)->take(2)->get()->pluck('id')->toArray();
- $this->be($this->user());
- $this->call('get', route('transactions.mass.delete', $withdrawals));
- $this->assertResponseStatus(200);
- $this->see('Delete a number of transactions');
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\MassController::destroy
- */
- public function testDestroy()
- {
- $this->session(['transactions.mass-delete.url' => 'http://localhost']);
- $deposits = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->take(2)->get()->pluck('id')->toArray();
- $data = [
- 'confirm_mass_delete' => $deposits,
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.mass.destroy'), $data);
- $this->assertSessionHas('success');
- $this->assertResponseStatus(302);
-
- // visit them should give 404.
- $this->call('get', route('transactions.show', [$deposits[0]]));
- $this->assertResponseStatus(404);
-
-
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\MassController::edit
- */
- public function testEdit()
- {
- $transfers = TransactionJournal::where('transaction_type_id', 3)->where('user_id', $this->user()->id)->take(2)->get()->pluck('id')->toArray();
- $this->be($this->user());
- $this->call('get', route('transactions.mass.delete', $transfers));
- $this->assertResponseStatus(200);
- $this->see('Edit a number of transactions');
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\MassController::update
- */
- public function testUpdate()
- {
- $deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)
- ->whereNull('deleted_at')
- ->first();
- $this->session(['transactions.mass-edit.url' => 'http://localhost']);
-
- $data = [
- 'journals' => [$deposit->id],
- 'description' => [$deposit->id => 'Updated salary thing'],
- 'amount' => [$deposit->id => 1600],
- 'amount_currency_id_amount_' . $deposit->id => 1,
- 'date' => [$deposit->id => '2014-07-24'],
- 'source_account_name' => [$deposit->id => 'Job'],
- 'destination_account_id' => [$deposit->id => 1],
- 'category' => [$deposit->id => 'Salary'],
- ];
-
- $this->be($this->user());
- $this->call('post', route('transactions.mass.update', [$deposit->id]), $data);
- $this->assertSessionHas('success');
- $this->assertResponseStatus(302);
-
- // visit them should show updated content
- $this->call('get', route('transactions.show', [$deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Updated salary thing');
- }
-
-}
diff --git a/tests/acceptance/Controllers/Transaction/SingleControllerTest.php b/tests/acceptance/Controllers/Transaction/SingleControllerTest.php
deleted file mode 100644
index 81e67a4e21..0000000000
--- a/tests/acceptance/Controllers/Transaction/SingleControllerTest.php
+++ /dev/null
@@ -1,141 +0,0 @@
-be($this->user());
- $this->call('get', route('transactions.create', ['withdrawal']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::delete
- */
- public function testDelete()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.delete', [12]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::destroy
- */
- public function testDestroy()
- {
- $this->session(['transactions.delete.url' => 'http://localhost']);
- $this->be($this->user());
-
- $repository = $this->mock(JournalRepositoryInterface::class);
- $repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
- $repository->shouldReceive('delete')->once();
-
- $this->call('post', route('transactions.destroy', [13]));
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit
- */
- public function testEdit()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.edit', [13]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::store
- */
- public function testStore()
- {
- $this->session(['transactions.create.url' => 'http://localhost']);
- $this->be($this->user());
-
- $data = [
- 'what' => 'withdrawal',
- 'amount' => '10',
- 'amount_currency_id_amount' => 1,
- 'source_account_id' => 1,
- 'destination_account_name' => 'Some destination',
- 'date' => '2016-01-01',
- 'description' => 'Test descr',
- ];
- $this->call('post', route('transactions.store', ['withdrawal']), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SingleController::update
- */
- public function testUpdate()
- {
- $this->session(['transactions.edit.url' => 'http://localhost']);
- $this->be($this->user());
- $data = [
- 'id' => 123,
- 'what' => 'withdrawal',
- 'description' => 'Updated groceries',
- 'source_account_id' => 1,
- 'destination_account_name' => 'PLUS',
- 'amount' => '123',
- 'amount_currency_id_amount' => 1,
- 'budget_id' => 1,
- 'category' => 'Daily groceries',
- 'tags' => '',
- 'date' => '2016-01-01',
- ];
-
- $this->call('post', route('transactions.update', [123]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- $this->call('get', route('transactions.show', [123]));
- $this->assertResponseStatus(200);
- $this->see('Updated groceries');
- // has bread crumb
- $this->see('');
-
- }
-}
diff --git a/tests/acceptance/Controllers/Transaction/SplitControllerTest.php b/tests/acceptance/Controllers/Transaction/SplitControllerTest.php
deleted file mode 100644
index df52e7af6f..0000000000
--- a/tests/acceptance/Controllers/Transaction/SplitControllerTest.php
+++ /dev/null
@@ -1,86 +0,0 @@
-where('user_id', $this->user()->id)->first();
- $this->be($this->user());
- $this->call('get', route('transactions.split.edit', [$deposit->id]));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\Transaction\SplitController::update
- * Implement testUpdate().
- */
- public function testUpdate()
- {
- $this->session(['transactions.edit-split.url' => 'http://localhost']);
- $deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
- $data = [
- 'id' => $deposit->id,
- 'what' => 'deposit',
- 'journal_description' => 'Updated salary',
- 'currency_id' => 1,
- 'journal_destination_account_id' => 1,
- 'journal_amount' => 1591,
- 'date' => '2014-01-24',
- 'tags' => '',
- 'transactions' => [
- [
- 'description' => 'Split #1',
- 'source_account_name' => 'Job',
- 'amount' => 1591,
- 'category' => '',
- ],
- ],
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.split.update', [$deposit->id]), $data);
- $this->assertResponseStatus(302);
- $this->assertSessionHas('success');
-
- // journal is updated?
- $this->call('get', route('transactions.show', [$deposit->id]));
- $this->assertResponseStatus(200);
- $this->see('Updated salary');
- // has bread crumb
- $this->see('');
- }
-
-}
diff --git a/tests/acceptance/Controllers/TransactionControllerTest.php b/tests/acceptance/Controllers/TransactionControllerTest.php
deleted file mode 100644
index d5e596fd60..0000000000
--- a/tests/acceptance/Controllers/TransactionControllerTest.php
+++ /dev/null
@@ -1,89 +0,0 @@
-be($this->user());
- $this->call('get', route('transactions.index', ['transfer']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::indexAll
- */
- public function testIndexAll()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.index.all', ['transfer']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::indexByDate
- */
- public function testIndexByDate()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.index.date', ['transfer', '2016-01-01']));
- $this->assertResponseStatus(200);
- // has bread crumb
- $this->see('');
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::reorder
- */
- public function testReorder()
- {
- $data = [
- 'items' => [],
- ];
- $this->be($this->user());
- $this->call('post', route('transactions.reorder'), $data);
- $this->assertResponseStatus(200);
- }
-
- /**
- * @covers \FireflyIII\Http\Controllers\TransactionController::show
- */
- public function testShow()
- {
- $this->be($this->user());
- $this->call('get', route('transactions.show', [1]));
- $this->assertResponseStatus(200);
- $this->see('');
- }
-}
diff --git a/tests/unit/Models/AccountTest.php b/tests/unit/Models/AccountTest.php
deleted file mode 100644
index 6be272929b..0000000000
--- a/tests/unit/Models/AccountTest.php
+++ /dev/null
@@ -1,83 +0,0 @@
- 1,
- 'name' => 'Test account #' . rand(1000, 9999),
- ];
- $account = Account::firstOrCreateEncrypted($data);
-
- $this->assertEquals($account->user_id, $data['user_id']);
- $this->assertEquals($account->name, $data['name']);
- }
-
- /**
- * @covers \FireflyIII\Models\Account::firstOrCreateEncrypted
- */
- public function testEncryptedIban()
- {
- $data = [
- 'user_id' => 1,
- 'iban' => 'NL64RABO0133183395',
- ];
- $account = Account::firstOrCreateEncrypted($data);
-
- $this->assertEquals($account->user_id, $data['user_id']);
- $this->assertEquals($account->name, $data['iban']);
- }
-
- /**
- * @covers \FireflyIII\Models\Account::firstOrCreateEncrypted
- * @expectedException \FireflyIII\Exceptions\FireflyException
- */
- public function testEncryptedNoId()
- {
- $data = [
- 'name' => 'Test account',
- ];
- $account = Account::firstOrCreateEncrypted($data);
- }
-
- /**
- * @covers \FireflyIII\Models\Account::routeBinder
- */
- public function testRouteBinder()
- {
- // not logged in?
- $this->be($this->user());
- $this->call('get', route('accounts.show', [1]));
-
- }
-
- /**
- * One that belongs to another user.
- *
- * @covers \FireflyIII\Models\Account::routeBinder
- */
- public function testRouteBinderError()
- {
- $account = Account::whereUserId(3)->first();
- $this->be($this->user());
- $this->call('get', route('accounts.show', [$account->id]));
- $this->assertResponseStatus(404);
- }
-}
\ No newline at end of file
diff --git a/tests/unit/Models/TransactionTypeTest.php b/tests/unit/Models/TransactionTypeTest.php
deleted file mode 100644
index 51d8a1ea76..0000000000
--- a/tests/unit/Models/TransactionTypeTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-first();
- $this->assertTrue($transactionType->isDeposit());
- }
-
- /**
- * @covers \FireflyIII\Models\TransactionType::isOpeningBalance
- */
- public function testIsOpeningBalance()
- {
- $transactionType = TransactionType::whereType(TransactionType::OPENING_BALANCE)->first();
- $this->assertTrue($transactionType->isOpeningBalance());
- }
-
- /**
- * @covers \FireflyIII\Models\TransactionType::isTransfer
- */
- public function testIsTransfer()
- {
- $transactionType = TransactionType::whereType(TransactionType::TRANSFER)->first();
- $this->assertTrue($transactionType->isTransfer());
- }
-
- /**
- * @covers \FireflyIII\Models\TransactionType::isWithdrawal
- */
- public function testIsWithdrawal()
- {
- $transactionType = TransactionType::whereType(TransactionType::WITHDRAWAL)->first();
- $this->assertTrue($transactionType->isWithdrawal());
- }
-}