Code cleanup.

This commit is contained in:
James Cole
2017-11-22 21:12:27 +01:00
parent 4e6b782204
commit 781ca052d8
142 changed files with 213 additions and 859 deletions

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -42,7 +41,6 @@ use Tests\TestCase;
/**
* Class AccountControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -79,7 +77,6 @@ class AccountControllerTest extends TestCase
$repository->shouldReceive('getAccountsByType')->withArgs([[AccountType::ASSET]])->andReturn(new Collection);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$account = $this->user()->accounts()->where('account_type_id', 3)->whereNull('deleted_at')->first();
$response = $this->get(route('accounts.delete', [$account->id]));
@@ -191,7 +188,6 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('getJournals')->andReturn(new Collection([$transaction]));
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([$transaction], 0, 10));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('accounts.show', [1]));
@@ -222,7 +218,6 @@ class AccountControllerTest extends TestCase
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([$transaction], 0, 10));
$tasker = $this->mock(AccountTaskerInterface::class);
$tasker->shouldReceive('amountOutInPeriod')->withAnyArgs()->andReturn('-1');
$tasker->shouldReceive('amountInInPeriod')->withAnyArgs()->andReturn('1');

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Admin;
use FireflyConfig;
use FireflyIII\Models\Configuration;
use Tests\TestCase;
@@ -31,14 +29,12 @@ use Tests\TestCase;
/**
* Class ConfigurationControllerTest
*
* @package Tests\Feature\Controllers\Admin
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ConfigurationControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::index
* @covers \FireflyIII\Http\Controllers\Admin\ConfigurationController::__construct
@@ -80,5 +76,4 @@ class ConfigurationControllerTest extends TestCase
$response->assertSessionHas('success');
$response->assertStatus(302);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Admin;
@@ -28,14 +27,12 @@ use Tests\TestCase;
/**
* Class HomeControllerTest
*
* @package Tests\Feature\Controllers\Admin
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class HomeControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Admin\HomeController::index
*/
@@ -47,5 +44,4 @@ class HomeControllerTest extends TestCase
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
}

View File

@@ -18,10 +18,8 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Admin;
use FireflyIII\Repositories\User\UserRepositoryInterface;
@@ -31,7 +29,6 @@ use Tests\TestCase;
/**
* Class UserControllerTest
*
* @package Tests\Feature\Controllers\Admin
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -111,6 +108,4 @@ class UserControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
@@ -32,7 +30,6 @@ use Tests\TestCase;
/**
* Class AttachmentControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -103,7 +100,6 @@ class AttachmentControllerTest extends TestCase
$repository->shouldReceive('exists')->once()->andReturn(false);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$response = $this->get(route('attachments.download', [1]));
$response->assertStatus(500);
@@ -159,6 +155,4 @@ class AttachmentControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,19 +18,16 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Auth;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use Tests\TestCase;
/**
* Class ForgotPasswordControllerTest
*
* @package Tests\Feature\Controllers\Auth
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Auth;
use FireflyIII\Models\Preference;
use PragmaRX\Google2FA\Contracts\Google2FA;
use Preferences;
@@ -32,7 +30,6 @@ use Tests\TestCase;
/**
* Class TwoFactorControllerTest
*
* @package Tests\Feature\Controllers\Auth
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -51,7 +48,6 @@ class TwoFactorControllerTest extends TestCase
$secretPreference = new Preference;
$secretPreference->data = 'BlablaSeecret';
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthEnabled', false])->andReturn($truePref)->twice();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret', null])->andReturn($secretPreference)->once();
Preferences::shouldReceive('get')->withArgs(['twoFactorAuthSecret'])->andReturn($secretPreference)->once();
@@ -130,5 +126,4 @@ class TwoFactorControllerTest extends TestCase
$response = $this->post(route('two-factor.post'), $data);
$response->assertStatus(302);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
use Carbon\Carbon;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Bill;
@@ -37,7 +35,6 @@ use Tests\TestCase;
/**
* Class BillControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -252,7 +249,5 @@ class BillControllerTest extends TestCase
$response = $this->post(route('bills.update', [1]), $data);
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -38,7 +37,6 @@ use Tests\TestCase;
/**
* Class BudgetControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -184,7 +182,6 @@ class BudgetControllerTest extends TestCase
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index'));
@@ -231,7 +228,6 @@ class BudgetControllerTest extends TestCase
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index', ['2017-01-01']));
@@ -278,7 +274,6 @@ class BudgetControllerTest extends TestCase
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$repository->shouldReceive('collectBudgetInformation')->andReturn($budgetInfo);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index', ['Hello-there']));
@@ -455,7 +450,6 @@ class BudgetControllerTest extends TestCase
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::showByBudgetLimit
* @expectedExceptionMessage This budget limit is not part of
*
*/
public function testShowByBadBudgetLimit()
{
@@ -484,7 +478,6 @@ class BudgetControllerTest extends TestCase
$accountRepository = $this->mock(AccountRepositoryInterface::class);
$accountRepository->shouldReceive('getAccountsByType')->andReturn(new Collection);
// mock budget repository
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
$budgetRepository->shouldReceive('spentInPeriod')->andReturn('1');
@@ -500,7 +493,6 @@ class BudgetControllerTest extends TestCase
$collector->shouldReceive('withBudgetInformation')->andReturnSelf();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.show.limit', [1, 1]));
@@ -575,5 +567,4 @@ class BudgetControllerTest extends TestCase
$response = $this->get(route('budgets.income', ['2017-01-01', '2017-01-31']));
$response->assertStatus(200);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -40,7 +39,6 @@ use Tests\TestCase;
/**
* Class CategoryControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -89,7 +87,6 @@ class CategoryControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('destroy')->andReturn(true);
$this->session(['categories.delete.uri' => 'http://localhost']);
@@ -360,7 +357,6 @@ class CategoryControllerTest extends TestCase
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
$repository->shouldReceive('earnedInPeriod')->andReturn('1');
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('categories.show', [1, '2015-01-01']));
@@ -456,6 +452,4 @@ class CategoryControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
@@ -43,14 +41,12 @@ use Tests\TestCase;
/**
* Class AccountControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class AccountControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Chart\AccountController::all
*/
@@ -85,7 +81,6 @@ class AccountControllerTest extends TestCase
$generator->shouldReceive('singleSet')->andReturn([]);
Steam::shouldReceive('balancesByAccounts')->twice()->andReturn([]);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.expense'));
@@ -114,7 +109,6 @@ class AccountControllerTest extends TestCase
$generator->shouldReceive('pieChart')->andReturn([]);
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.expense-budget', [1, '20120101', '20120131']));
@@ -145,7 +139,6 @@ class AccountControllerTest extends TestCase
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection);
$accountRepos->shouldReceive('oldestJournalDate')->andReturn(Carbon::createFromTimestamp(time())->startOfMonth());
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.account.expense-budget-all', [1]));
@@ -374,5 +367,4 @@ class AccountControllerTest extends TestCase
$response = $this->get(route('chart.account.single', [1]));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Transaction;
@@ -34,7 +32,6 @@ use Tests\TestCase;
/**
* Class BillControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -82,5 +79,4 @@ class BillControllerTest extends TestCase
$response = $this->get(route('chart.bill.single', [1]));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
@@ -42,14 +40,12 @@ use Tests\TestCase;
/**
* Class BudgetControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class BudgetControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::budget
* @covers \FireflyIII\Http\Controllers\Chart\BudgetController::__construct
@@ -66,7 +62,6 @@ class BudgetControllerTest extends TestCase
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
$generator->shouldReceive('singleSet')->andReturn([])->once();
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.budget.budget', [1]));
@@ -84,7 +79,6 @@ class BudgetControllerTest extends TestCase
$repository = $this->mock(BudgetRepositoryInterface::class);
$generator = $this->mock(GeneratorInterface::class);
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
$generator->shouldReceive('singleSet')->once()->andReturn([]);
@@ -214,7 +208,6 @@ class BudgetControllerTest extends TestCase
$budgetLimit->budget_id = $budget->id;
$transaction = factory(Transaction::class)->make();
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]))->once();
$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection([$budgetLimit]));
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
@@ -254,7 +247,6 @@ class BudgetControllerTest extends TestCase
$two->budget_id = $budget->id;
$transaction = factory(Transaction::class)->make();
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]))->once();
$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection([$one, $two]));
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
@@ -290,7 +282,6 @@ class BudgetControllerTest extends TestCase
$budget = factory(Budget::class)->make();
$transaction = factory(Transaction::class)->make();
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
$repository->shouldReceive('getBudgetLimits')->once()->andReturn(new Collection);
$repository->shouldReceive('spentInPeriod')->andReturn('-100');
@@ -325,7 +316,6 @@ class BudgetControllerTest extends TestCase
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$generator->shouldReceive('multiSet')->once()->andReturn([]);
$this->be($this->user());
$response = $this->get(route('chart.budget.period', [1, '1', '20120101', '20120131']));
$response->assertStatus(200);

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
@@ -41,7 +39,6 @@ use Tests\TestCase;
/**
* Class BudgetReportControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -117,7 +114,6 @@ class BudgetReportControllerTest extends TestCase
$budgetRepos->shouldReceive('getAllBudgetLimits')->andReturn(new Collection([$one, $two]))->once();
$collector->shouldReceive('setAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL, TransactionType::TRANSFER]])->andReturnSelf();
@@ -134,5 +130,4 @@ class BudgetReportControllerTest extends TestCase
$response = $this->get(route('chart.budget.main', ['1', '1', '20120101', '20120131', 0]));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use Carbon\Carbon;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Models\Account;
@@ -37,14 +35,12 @@ use Tests\TestCase;
/**
* Class CategoryControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class CategoryControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::all
* @covers \FireflyIII\Http\Controllers\Chart\CategoryController::__construct
@@ -64,7 +60,6 @@ class CategoryControllerTest extends TestCase
$accountRepos->shouldReceive('getAccountsByType')->withArgs([[AccountType::DEFAULT, AccountType::ASSET]])->andReturn(new Collection)->once();
$generator->shouldReceive('multiSet')->once()->andReturn([]);
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('chart.category.all', [1]));
@@ -109,7 +104,6 @@ class CategoryControllerTest extends TestCase
$repository->shouldReceive('periodIncome')->andReturn([])->once();
$generator->shouldReceive('multiSet')->andReturn([])->once();
$this->be($this->user());
$response = $this->get(route('chart.category.period', [1, '1', '20120101', '20120131']));
$response->assertStatus(200);
@@ -156,5 +150,4 @@ class CategoryControllerTest extends TestCase
$response = $this->get(route('chart.category.specific', ['1', '2012-01-01']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
@@ -38,14 +36,12 @@ use Tests\TestCase;
/**
* Class CategoryReportControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class CategoryReportControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::accountExpense
* @covers \FireflyIII\Http\Controllers\Chart\CategoryReportController::__construct
@@ -160,5 +156,4 @@ class CategoryReportControllerTest extends TestCase
$response = $this->get(route('chart.category.main', ['1', '1', '20120101', '20120131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Models\PiggyBankEvent;
use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
@@ -33,7 +31,6 @@ use Tests\TestCase;
/**
* Class PiggyBankControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -57,6 +54,4 @@ class PiggyBankControllerTest extends TestCase
$response = $this->get(route('chart.piggy-bank.history', [1]));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use Steam;
@@ -32,14 +30,12 @@ use Tests\TestCase;
/**
* Class ReportControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ReportControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::netWorth
* @covers \FireflyIII\Http\Controllers\Chart\ReportController::arraySum
@@ -96,5 +92,4 @@ class ReportControllerTest extends TestCase
$response = $this->get(route('chart.report.sum', [1, '20120101', '20120131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Chart;
use FireflyIII\Generator\Chart\Basic\GeneratorInterface;
use FireflyIII\Helpers\Chart\MetaPieChartInterface;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
@@ -40,7 +38,6 @@ use Tests\TestCase;
/**
* Class TagReportControllerTest
*
* @package Tests\Feature\Controllers\Chart
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -88,7 +85,6 @@ class TagReportControllerTest extends TestCase
$this->be($this->user());
$response = $this->get(route('chart.tag.account-income', ['1', 'housing', '20120101', '20120131', 0]));
$response->assertStatus(200);
}
/**
@@ -144,16 +140,13 @@ class TagReportControllerTest extends TestCase
$generator = $this->mock(GeneratorInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$set = new Collection;
for ($i = 0; $i < 10; $i++) {
for ($i = 0; $i < 10; ++$i) {
$transaction = factory(Transaction::class)->make();
$tag = factory(Tag::class)->make();
$transaction->transactionJournal->tags()->save($tag);
$set->push($transaction);
}
$collector->shouldReceive('setAccounts')->andReturnSelf();
$collector->shouldReceive('setRange')->andReturnSelf();
$collector->shouldReceive('setTypes')->withArgs([[TransactionType::WITHDRAWAL, TransactionType::TRANSFER]])->andReturnSelf();
@@ -213,6 +206,4 @@ class TagReportControllerTest extends TestCase
$response = $this->get(route('chart.tag.tag-income', ['1', 'housing', '20120101', '20120131', 0]));
$response->assertStatus(200);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -34,14 +33,12 @@ use Tests\TestCase;
/**
* Class CurrencyControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class CurrencyControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/
@@ -73,7 +70,6 @@ class CurrencyControllerTest extends TestCase
$repository->shouldReceive('canDeleteCurrency')->andReturn(false);
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
$this->be($this->user());
$response = $this->get(route('currencies.delete', [2]));
$response->assertStatus(302);
@@ -95,7 +91,6 @@ class CurrencyControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
$this->session(['currencies.delete.uri' => 'http://localhost']);
$this->be($this->user());
$response = $this->post(route('currencies.destroy', [1]));
@@ -174,7 +169,6 @@ class CurrencyControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$userRepos->shouldReceive('hasRole')->once()->andReturn(true);
$this->session(['currencies.delete.uri' => 'http://localhost']);
$this->be($this->user());
$response = $this->post(route('currencies.destroy', [1]));
@@ -328,5 +322,4 @@ class CurrencyControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -37,14 +36,12 @@ use Tests\TestCase;
/**
* Class ExportControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ExportControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\ExportController::download
*/
@@ -134,7 +131,6 @@ class ExportControllerTest extends TestCase
['first' => new Carbon('2014-01-01')]
);
$data = [
'export_start_range' => '2015-01-01',
'export_end_range' => '2015-01-21',
@@ -167,5 +163,4 @@ class ExportControllerTest extends TestCase
$response->assertStatus(200);
$response->assertSee('ok');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -30,14 +29,12 @@ use Tests\TestCase;
/**
* Class HelpControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class HelpControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\HelpController::show
* @covers \FireflyIII\Http\Controllers\HelpController::getHelpText
@@ -65,7 +62,7 @@ class HelpControllerTest extends TestCase
{
// force pref in dutch for test
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL',]);
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL']);
$help = $this->mock(HelpInterface::class);
$help->shouldReceive('hasRoute')->withArgs(['index'])->andReturn(true)->once();
@@ -83,7 +80,7 @@ class HelpControllerTest extends TestCase
// put English back:
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US',]);
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US']);
}
/**
@@ -94,7 +91,7 @@ class HelpControllerTest extends TestCase
{
// force pref in dutch for test
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL',]);
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'nl_NL']);
$help = $this->mock(HelpInterface::class);
$help->shouldReceive('hasRoute')->withArgs(['index'])->andReturn(true)->once();
@@ -112,7 +109,7 @@ class HelpControllerTest extends TestCase
// put English back:
Preference::where('user_id', $this->user()->id)->where('name', 'language')->delete();
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US',]);
Preference::create(['user_id' => $this->user()->id, 'name' => 'language', 'data' => 'en_US']);
}
/**
@@ -146,5 +143,4 @@ class HelpControllerTest extends TestCase
$response->assertStatus(200);
$response->assertSee('There is no help for this route.');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -36,7 +35,6 @@ use Tests\TestCase;
/**
* Class HomeControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -53,7 +51,6 @@ class HomeControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$args = [
@@ -76,7 +73,6 @@ class HomeControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$args = [
@@ -191,5 +187,4 @@ class HomeControllerTest extends TestCase
$response->assertSessionHas('warning');
$response->assertSessionHas('error');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Import;
@@ -33,7 +32,6 @@ use Tests\TestCase;
/**
* Class FileControllerTest
*
* @package Tests\Feature\Controllers\Import
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -54,7 +52,6 @@ class FileControllerTest extends TestCase
$configurator->shouldReceive('getNextView')->once()->andReturn('import.csv.initial');
$configurator->shouldReceive('getNextData')->andReturn(['specifics' => [], 'delimiters' => [], 'accounts' => []])->once();
$this->be($this->user());
$response = $this->get(route('import.file.configure', ['configure']));
$response->assertStatus(200);
@@ -89,7 +86,6 @@ class FileControllerTest extends TestCase
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\Import\FileController::initialize
*/
@@ -156,7 +152,6 @@ class FileControllerTest extends TestCase
$configurator->shouldReceive('configureJob')->once()->andReturn(false);
$configurator->shouldReceive('getWarningMessage')->once()->andReturn('');
$this->be($this->user());
$response = $this->post(route('import.file.process-configuration', ['running']));
$response->assertStatus(302);
@@ -172,7 +167,6 @@ class FileControllerTest extends TestCase
$configurator->shouldReceive('setJob')->once();
$configurator->shouldReceive('isJobConfigured')->once()->andReturn(true);
$this->be($this->user());
$response = $this->post(route('import.file.process-configuration', ['running']));
$response->assertStatus(302);
@@ -188,7 +182,6 @@ class FileControllerTest extends TestCase
$importer->shouldReceive('setJob')->once();
$importer->shouldReceive('run')->once()->andReturn(true);
$this->be($this->user());
$response = $this->post(route('import.file.start', ['running']));
$response->assertStatus(200);
@@ -204,7 +197,6 @@ class FileControllerTest extends TestCase
$importer->shouldReceive('setJob')->once();
$importer->shouldReceive('run')->once()->andReturn(false);
$this->be($this->user());
$response = $this->post(route('import.file.start', ['running']));
$response->assertStatus(500);
@@ -230,5 +222,4 @@ class FileControllerTest extends TestCase
$response->assertStatus(302);
$response->assertRedirect(route('import.file.configure', ['new']));
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -28,14 +27,12 @@ use Tests\TestCase;
/**
* Class ImportControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ImportControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\ImportController::index
*/
@@ -46,6 +43,4 @@ class ImportControllerTest extends TestCase
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -34,7 +33,6 @@ use Tests\TestCase;
/**
* Class JavascriptControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -83,12 +81,9 @@ class JavascriptControllerTest extends TestCase
*/
public function testVariables(string $range)
{
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('javascript.variables'));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Json;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
@@ -35,13 +33,9 @@ use Tests\TestCase;
/**
* Class AutoCompleteControllerTest
*
* @package Tests\Feature\Controllers\Json
*/
class AutoCompleteControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Json\AutoCompleteController::allAccounts
*/
@@ -131,5 +125,4 @@ class AutoCompleteControllerTest extends TestCase
$response->assertStatus(200);
$response->assertExactJson([]);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Json;
use FireflyIII\Models\CurrencyExchangeRate;
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
use Tests\TestCase;
@@ -31,14 +29,12 @@ use Tests\TestCase;
/**
* Class ExchangeControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ExchangeControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Json\ExchangeController::getRate
*/

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -37,7 +36,6 @@ use Tests\TestCase;
/**
* Class JsonControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -93,7 +91,6 @@ class JsonControllerTest extends TestCase
$response->assertExactJson([$category->name]);
}
/**
* @covers \FireflyIII\Http\Controllers\JsonController::tags
*/
@@ -141,5 +138,4 @@ class JsonControllerTest extends TestCase
$response = $this->get(route('json.trigger'));
$response->assertStatus(200);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -31,14 +30,12 @@ use Tests\TestCase;
/**
* Class NewUserControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class NewUserControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\NewUserController::index
* @covers \FireflyIII\Http\Controllers\NewUserController::__construct
@@ -69,7 +66,6 @@ class NewUserControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('count')->andReturn(1);
$this->be($this->user());
$response = $this->get(route('new-user.index'));
$response->assertStatus(302);
@@ -89,7 +85,6 @@ class NewUserControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('store')->times(2);
$data = [
'bank_name' => 'New bank',
'savings_balance' => '1000',
@@ -121,5 +116,4 @@ class NewUserControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -37,14 +36,12 @@ use Tests\TestCase;
/**
* Class PiggyBankControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class PiggyBankControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\PiggyBankController::add
*/
@@ -139,7 +136,6 @@ class PiggyBankControllerTest extends TestCase
$repository->shouldReceive('destroy')->andReturn(true);
$this->session(['piggy-banks.delete.uri' => 'http://localhost']);
$this->be($this->user());
$response = $this->post(route('piggy-banks.destroy', [2]));
@@ -240,7 +236,6 @@ class PiggyBankControllerTest extends TestCase
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('canAddAmount')->once()->andReturn(false);
$data = ['amount' => '1000'];
$this->be($this->user());
$response = $this->post(route('piggy-banks.add', [1]), $data);
@@ -297,7 +292,6 @@ class PiggyBankControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$response = $this->get(route('piggy-banks.remove', [1]));
$response->assertStatus(200);
@@ -352,7 +346,6 @@ class PiggyBankControllerTest extends TestCase
'targetamount' => '100.123',
'account_id' => 2,
'amount_currency_id_targetamount' => 1,
];
$this->be($this->user());
$response = $this->post(route('piggy-banks.store'), $data);
@@ -378,7 +371,6 @@ class PiggyBankControllerTest extends TestCase
'targetamount' => '100.123',
'account_id' => 2,
'amount_currency_id_targetamount' => 1,
];
$this->be($this->user());
$response = $this->post(route('piggy-banks.update', [3]), $data);
@@ -386,6 +378,4 @@ class PiggyBankControllerTest extends TestCase
$response->assertSessionHas('success');
$response->assertRedirect(route('index'));
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Popup;
use Carbon\Carbon;
use FireflyIII\Helpers\Report\PopupReportInterface;
use FireflyIII\Models\Account;
@@ -35,18 +33,15 @@ use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Illuminate\Support\Collection;
use Tests\TestCase;
/**
* Class ReportControllerTest
*
* @package Tests\Feature\Controllers\Popup
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ReportControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::__construct
* @covers \FireflyIII\Http\Controllers\Popup\ReportController::general
@@ -176,7 +171,6 @@ class ReportControllerTest extends TestCase
$budgetRepos = $this->mock(BudgetRepositoryInterface::class);
$popupHelper = $this->mock(PopupReportInterface::class);
$budget = factory(Budget::class)->make();
$account = factory(Account::class)->make();
@@ -232,7 +226,6 @@ class ReportControllerTest extends TestCase
],
];
$uri = route('popup.general') . '?' . http_build_query($arguments);
$response = $this->get($uri);
$response->assertStatus(500);
@@ -385,6 +378,4 @@ class ReportControllerTest extends TestCase
$response = $this->get($uri);
$response->assertStatus(500);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -36,14 +35,12 @@ use Tests\TestCase;
/**
* Class PreferencesControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class PreferencesControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\PreferencesController::code
* @covers \FireflyIII\Http\Controllers\PreferencesController::getDomain
@@ -231,5 +228,4 @@ class PreferencesControllerTest extends TestCase
// go to code to get a secret.
$response->assertRedirect(route('preferences.code'));
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -31,14 +30,12 @@ use Tests\TestCase;
/**
* Class ProfileControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ProfileControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\ProfileController::changePassword
*/
@@ -190,5 +187,4 @@ class ProfileControllerTest extends TestCase
$response->assertRedirect(route('profile.delete-account'));
$response->assertSessionHas('error');
}
}

View File

@@ -18,19 +18,16 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use FireflyIII\Repositories\Account\AccountTaskerInterface;
use Tests\TestCase;
/**
* Class AccountControllerTest
*
* @package Tests\Feature\Controllers\Report
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -52,10 +49,8 @@ class AccountControllerTest extends TestCase
$tasker = $this->mock(AccountTaskerInterface::class);
$tasker->shouldReceive('getAccountReport')->andReturn($return);
$this->be($this->user());
$response = $this->get(route('report-data.account.general', ['1', '20120101', '20120131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use FireflyIII\Helpers\Collection\Balance;
use FireflyIII\Helpers\Report\BalanceReportHelperInterface;
use Tests\TestCase;
@@ -31,7 +29,6 @@ use Tests\TestCase;
/**
* Class BalanceControllerTest
*
* @package Tests\Feature\Controllers\Report
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -50,5 +47,4 @@ class BalanceControllerTest extends TestCase
$response = $this->get(route('report-data.balance.general', ['1', '20120101', '20120131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use FireflyIII\Helpers\Report\BudgetReportHelperInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use Illuminate\Support\Collection;
@@ -32,7 +30,6 @@ use Tests\TestCase;
/**
* Class BudgetControllerTest
*
* @package Tests\Feature\Controllers\Report
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -70,5 +67,4 @@ class BudgetControllerTest extends TestCase
$response = $this->get(route('report-data.budget.period', ['1', '20120101', '20120131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use FireflyIII\Models\Category;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;
use Illuminate\Support\Collection;
@@ -32,7 +30,6 @@ use Tests\TestCase;
/**
* Class CategoryControllerTest
*
* @package Tests\Feature\Controllers\Report
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -89,5 +86,4 @@ class CategoryControllerTest extends TestCase
$response = $this->get(route('report-data.category.operations', ['1', '20120101', '20120131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Report;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Helpers\Filter\InternalTransferFilter;
use FireflyIII\Models\Transaction;
@@ -33,7 +31,6 @@ use Tests\TestCase;
/**
* Class OperationsControllerTest
*
* @package Tests\Feature\Controllers\Report
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -55,7 +52,6 @@ class OperationsControllerTest extends TestCase
$collector->shouldReceive('addFilter')->withArgs([InternalTransferFilter::class])->andReturnSelf();
$collector->shouldReceive('getJournals')->andReturn($transactions);
$this->be($this->user());
$response = $this->get(route('report-data.operations.expenses', ['1', '20160101', '20160131']));
$response->assertStatus(200);
@@ -101,5 +97,4 @@ class OperationsControllerTest extends TestCase
$response = $this->get(route('report-data.operations.operations', ['1', '20160101', '20160131']));
$response->assertStatus(200);
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
use FireflyIII\Generator\Report\Audit\YearReportGenerator as AYRG;
use FireflyIII\Generator\Report\Budget\YearReportGenerator as BYRG;
use FireflyIII\Generator\Report\Category\YearReportGenerator as CYRG;
@@ -46,14 +44,12 @@ use Tests\TestCase;
/**
* Class ReportControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class ReportControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\ReportController::auditReport
*/
@@ -68,7 +64,6 @@ class ReportControllerTest extends TestCase
$generator->shouldReceive('setAccounts')->once();
$generator->shouldReceive('generate')->andReturn('here-be-report')->once();
$this->be($this->user());
$response = $this->get(route('reports.report.audit', [1, '20160101', '20160131']));
$response->assertStatus(200);
@@ -189,7 +184,6 @@ class ReportControllerTest extends TestCase
$budget = factory(Budget::class)->make();
$budgetRepos->shouldReceive('getBudgets')->andReturn(new Collection([$budget]));
$this->be($this->user());
$response = $this->get(route('reports.options', ['budget']));
$response->assertStatus(200);
@@ -458,5 +452,4 @@ class ReportControllerTest extends TestCase
$response = $this->get(route('reports.report.tag', [1, 'TagJanuary', '20160101', '20160131']));
$response->assertStatus(200);
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -37,14 +36,12 @@ use Tests\TestCase;
/**
* Class RuleControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class RuleControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\RuleController::create
*/
@@ -77,7 +74,6 @@ class RuleControllerTest extends TestCase
];
$this->session(['_old_input' => $old]);
// mock stuff
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
@@ -223,7 +219,7 @@ class RuleControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$data = ['actions' => [1, 2, 3],];
$data = ['actions' => [1, 2, 3]];
$repository->shouldReceive('reorderRuleActions')->once();
$this->be($this->user());
@@ -241,7 +237,7 @@ class RuleControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$data = ['triggers' => [1, 2, 3],];
$data = ['triggers' => [1, 2, 3]];
$repository->shouldReceive('reorderRuleTriggers')->once();
$this->be($this->user());
@@ -289,7 +285,6 @@ class RuleControllerTest extends TestCase
}
/**
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
@@ -419,5 +414,4 @@ class RuleControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -36,14 +35,12 @@ use Tests\TestCase;
/**
* Class RuleGroupControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class RuleGroupControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\RuleGroupController::create
* @covers \FireflyIII\Http\Controllers\RuleGroupController::__construct
@@ -122,7 +119,6 @@ class RuleGroupControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$response = $this->get(route('rule-groups.edit', [1]));
$response->assertStatus(200);
@@ -191,7 +187,6 @@ class RuleGroupControllerTest extends TestCase
'description' => 'No description',
];
$this->be($this->user());
$response = $this->post(route('rule-groups.store', [1]), $data);
$response->assertStatus(302);
@@ -239,5 +234,4 @@ class RuleGroupControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -29,14 +28,12 @@ use Tests\TestCase;
/**
* Class SearchControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class SearchControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\SearchController::index
* @covers \FireflyIII\Http\Controllers\SearchController::__construct
@@ -51,5 +48,4 @@ class SearchControllerTest extends TestCase
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -33,18 +32,15 @@ use FireflyIII\Repositories\Tag\TagRepositoryInterface;
use Illuminate\Pagination\LengthAwarePaginator;
use Tests\TestCase;
/**
* Class TagControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class TagControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\TagController::create
*/
@@ -161,7 +157,6 @@ class TagControllerTest extends TestCase
$collector->shouldReceive('setRange')->andReturnSelf()->once();
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->once();
$this->be($this->user());
$response = $this->get(route('tags.show', [1]));
$response->assertStatus(200);
@@ -198,7 +193,6 @@ class TagControllerTest extends TestCase
];
$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();
$this->be($this->user());
$response = $this->get(route('tags.show', [1, 'all']));
$response->assertStatus(200);
@@ -238,7 +232,6 @@ class TagControllerTest extends TestCase
];
$repository->shouldReceive('sumsOfTag')->andReturn($amounts)->once();
$this->be($this->user());
$response = $this->get(route('tags.show', [1, '2016-01-01']));
$response->assertStatus(200);
@@ -278,7 +271,6 @@ class TagControllerTest extends TestCase
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->session(['tags.edit.uri' => 'http://localhost']);
$data = [
'tag' => 'Hello updated tag' . rand(999, 10000),
@@ -293,5 +285,4 @@ class TagControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionHas('success');
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Transaction;
use DB;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
@@ -37,7 +35,6 @@ use Tests\TestCase;
/**
* Class ConvertControllerTest
*
* @package Tests\Feature\Controllers\Transaction
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -217,7 +214,7 @@ class ConvertControllerTest extends TestCase
$accountRepos->shouldReceive('store')->andReturn(new Account);
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
$data = ['destination_account_expense' => 'New expense name.',];
$data = ['destination_account_expense' => 'New expense name.'];
$this->be($this->user());
$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);
$response->assertStatus(302);
@@ -240,7 +237,7 @@ class ConvertControllerTest extends TestCase
$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();
$deposit = TransactionJournal::where('transaction_type_id', 2)->where('user_id', $this->user()->id)->first();
$data = ['destination_account_expense' => '',];
$data = ['destination_account_expense' => ''];
$this->be($this->user());
$response = $this->post(route('transactions.convert.index', ['withdrawal', $deposit->id]), $data);
$response->assertStatus(302);
@@ -261,7 +258,6 @@ class ConvertControllerTest extends TestCase
$repository->shouldReceive('convert')->andReturn($messageBag);
$repository->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
$data = [
'destination_account_asset' => 2,
@@ -360,7 +356,7 @@ class ConvertControllerTest extends TestCase
$accountRepos->shouldReceive('store')->andReturn(new Account)->once();
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
$data = ['source_account_revenue' => 'New revenue name.',];
$data = ['source_account_revenue' => 'New revenue name.'];
$this->be($this->user());
$response = $this->post(route('transactions.convert.index', ['deposit', $withdrawal->id]), $data);
$response->assertStatus(302);
@@ -383,7 +379,7 @@ class ConvertControllerTest extends TestCase
$accountRepos->shouldReceive('getCashAccount')->andReturn(new Account)->once();
$withdrawal = TransactionJournal::where('transaction_type_id', 1)->where('user_id', $this->user()->id)->first();
$data = ['source_account_revenue' => '',];
$data = ['source_account_revenue' => ''];
$this->be($this->user());
$response = $this->post(route('transactions.convert.index', ['deposit', $withdrawal->id]), $data);
$response->assertStatus(302);
@@ -414,6 +410,4 @@ class ConvertControllerTest extends TestCase
$response->assertStatus(302);
$response->assertRedirect(route('transactions.show', [$withdrawal->id]));
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Transaction;
use DB;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\TransactionJournal;
@@ -36,7 +34,6 @@ use Tests\TestCase;
/**
* Class MassControllerTest
*
* @package Tests\Feature\Controllers\Transaction
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -193,7 +190,6 @@ class MassControllerTest extends TestCase
$repository->shouldReceive('update')->once();
$repository->shouldReceive('find')->once()->andReturn($deposit);
$this->session(['transactions.mass-edit.uri' => 'http://localhost']);
$data = [

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Transaction;
use DB;
use FireflyIII\Events\StoredTransactionJournal;
use FireflyIII\Events\UpdatedTransactionJournal;
@@ -45,14 +43,12 @@ use Tests\TestCase;
/**
* Class SingleControllerTest
*
* @package Tests\Feature\Controllers\Transaction
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class SingleControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::cloneTransaction
*/
@@ -78,7 +74,6 @@ class SingleControllerTest extends TestCase
$piggyRepos = $this->mock(PiggyBankRepositoryInterface::class);
$piggyRepos->shouldReceive('getPiggyBanksWithAmount')->andReturn(new Collection)->once();
$this->be($this->user());
$response = $this->get(route('transactions.create', ['withdrawal']));
$response->assertStatus(200);
@@ -206,7 +201,6 @@ class SingleControllerTest extends TestCase
$response->assertStatus(302);
}
/**
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::edit
* @covers \FireflyIII\Http\Controllers\Transaction\SingleController::groupedAccountList
@@ -317,14 +311,12 @@ class SingleControllerTest extends TestCase
$messages = new MessageBag;
$messages->add('attachments', 'Fake error');
// mock attachment helper, trigger an error AND and info thing.
$attachmentRepo = $this->mock(AttachmentHelperInterface::class);
$attachmentRepo->shouldReceive('saveAttachmentsForModel');
$attachmentRepo->shouldReceive('getErrors')->andReturn($errors);
$attachmentRepo->shouldReceive('getMessages')->andReturn($messages);
$this->session(['transactions.create.uri' => 'http://localhost']);
$this->be($this->user());
@@ -360,7 +352,6 @@ class SingleControllerTest extends TestCase
$journal->description = 'New journal';
$journal->transactionType()->associate($type);
$repository->shouldReceive('update')->andReturn($journal);
$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);
@@ -389,7 +380,5 @@ class SingleControllerTest extends TestCase
$response->assertSee('Updated groceries');
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
}

View File

@@ -18,12 +18,10 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers\Transaction;
use FireflyIII\Helpers\Attachments\AttachmentHelperInterface;
use FireflyIII\Models\AccountType;
use FireflyIII\Models\Transaction;
@@ -40,7 +38,6 @@ use Tests\TestCase;
/**
* Class SplitControllerTest
*
* @package Tests\Feature\Controllers\Transaction
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -55,7 +52,6 @@ class SplitControllerTest extends TestCase
*/
public function testEdit()
{
$currencyRepository = $this->mock(CurrencyRepositoryInterface::class);
$accountRepository = $this->mock(AccountRepositoryInterface::class);
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
@@ -71,7 +67,6 @@ class SplitControllerTest extends TestCase
$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
$tasker->shouldReceive('getTransactionsOverview')->andReturn($transactions->toArray());
$this->be($this->user());
$response = $this->get(route('transactions.split.edit', [$deposit->id]));
$response->assertStatus(200);
@@ -98,7 +93,6 @@ class SplitControllerTest extends TestCase
*/
public function testEditSingle()
{
$currencyRepository = $this->mock(CurrencyRepositoryInterface::class);
$accountRepository = $this->mock(AccountRepositoryInterface::class);
$budgetRepository = $this->mock(BudgetRepositoryInterface::class);
@@ -114,7 +108,6 @@ class SplitControllerTest extends TestCase
$budgetRepository->shouldReceive('getActiveBudgets')->andReturn(new Collection);
$tasker->shouldReceive('getTransactionsOverview')->andReturn($transactions->toArray());
$this->be($this->user());
$response = $this->get(route('transactions.split.edit', [$deposit->id]));
$response->assertStatus(200);
@@ -158,7 +151,6 @@ class SplitControllerTest extends TestCase
$repository->shouldReceive('updateSplitJournal')->andReturn($deposit);
$repository->shouldReceive('first')->times(2)->andReturn(new TransactionJournal);
$attachmentRepos = $this->mock(AttachmentHelperInterface::class);
$attachmentRepos->shouldReceive('saveAttachmentsForModel');
$attachmentRepos->shouldReceive('getMessages')->andReturn(new MessageBag);
@@ -191,5 +183,4 @@ class SplitControllerTest extends TestCase
$response->assertStatus(302);
$response->assertSessionMissing('success');
}
}

View File

@@ -18,7 +18,6 @@
* You should have received a copy of the GNU General Public License
* along with Firefly III. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace Tests\Feature\Controllers;
@@ -36,15 +35,12 @@ use Tests\TestCase;
/**
* Class TransactionControllerTest
*
* @package Tests\Feature\Controllers
* @SuppressWarnings(PHPMD.TooManyPublicMethods)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class TransactionControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\TransactionController::index
* @covers \FireflyIII\Http\Controllers\TransactionController::__construct
@@ -254,5 +250,4 @@ class TransactionControllerTest extends TestCase
$response = $this->get(route('transactions.show', [$journal->id]));
$response->assertStatus(302);
}
}