Some code cleanup.

This commit is contained in:
James Cole 2017-07-08 06:28:44 +02:00
parent de9728895e
commit 5ef2067836
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
53 changed files with 597 additions and 449 deletions

View File

@ -16,6 +16,7 @@
line-height: 22px;
cursor: text;
}
.bootstrap-tagsinput input {
border: none;
box-shadow: none;
@ -26,35 +27,44 @@
width: auto;
max-width: inherit;
}
.bootstrap-tagsinput.form-control input::-moz-placeholder {
color: #777;
opacity: 1;
}
.bootstrap-tagsinput.form-control input:-ms-input-placeholder {
color: #777;
}
.bootstrap-tagsinput.form-control input::-webkit-input-placeholder {
color: #777;
}
.bootstrap-tagsinput input:focus {
border: none;
box-shadow: none;
}
.bootstrap-tagsinput .tag {
margin-right: 2px;
color: white;
}
.bootstrap-tagsinput .tag [data-role="remove"] {
margin-left: 8px;
cursor: pointer;
}
.bootstrap-tagsinput .tag [data-role="remove"]:after {
content: "x";
padding: 0px 2px;
}
.bootstrap-tagsinput .tag [data-role="remove"]:hover {
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
}
.bootstrap-tagsinput .tag [data-role="remove"]:hover:active {
box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

View File

@ -8,79 +8,121 @@
margin-top: 1px;
top: 100px;
left: 20px;
/* Calendars */ }
/* Calendars */
}
.daterangepicker:before, .daterangepicker:after {
position: absolute;
display: inline-block;
border-bottom-color: rgba(0, 0, 0, 0.2);
content: ''; }
content: '';
}
.daterangepicker:before {
top: -7px;
border-right: 7px solid transparent;
border-left: 7px solid transparent;
border-bottom: 7px solid #ccc; }
border-bottom: 7px solid #ccc;
}
.daterangepicker:after {
top: -6px;
border-right: 6px solid transparent;
border-bottom: 6px solid #fff;
border-left: 6px solid transparent; }
border-left: 6px solid transparent;
}
.daterangepicker.opensleft:before {
right: 9px; }
right: 9px;
}
.daterangepicker.opensleft:after {
right: 10px; }
right: 10px;
}
.daterangepicker.openscenter:before {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto; }
margin-right: auto;
}
.daterangepicker.openscenter:after {
left: 0;
right: 0;
width: 0;
margin-left: auto;
margin-right: auto; }
margin-right: auto;
}
.daterangepicker.opensright:before {
left: 9px; }
left: 9px;
}
.daterangepicker.opensright:after {
left: 10px; }
left: 10px;
}
.daterangepicker.dropup {
margin-top: -5px; }
margin-top: -5px;
}
.daterangepicker.dropup:before {
top: initial;
bottom: -7px;
border-bottom: initial;
border-top: 7px solid #ccc; }
border-top: 7px solid #ccc;
}
.daterangepicker.dropup:after {
top: initial;
bottom: -6px;
border-bottom: initial;
border-top: 6px solid #fff; }
border-top: 6px solid #fff;
}
.daterangepicker.dropdown-menu {
max-width: none;
z-index: 3001; }
z-index: 3001;
}
.daterangepicker.single .ranges, .daterangepicker.single .calendar {
float: none; }
float: none;
}
.daterangepicker.show-calendar .calendar {
display: block; }
display: block;
}
.daterangepicker .calendar {
display: none;
max-width: 270px;
margin: 4px; }
margin: 4px;
}
.daterangepicker .calendar.single .calendar-table {
border: none; }
border: none;
}
.daterangepicker .calendar th, .daterangepicker .calendar td {
white-space: nowrap;
text-align: center;
min-width: 32px; }
min-width: 32px;
}
.daterangepicker .calendar-table {
border: 1px solid #fff;
padding: 4px;
border-radius: 4px;
background: #fff; }
background: #fff;
}
.daterangepicker table {
width: 100%;
margin: 0; }
margin: 0;
}
.daterangepicker td, .daterangepicker th {
text-align: center;
width: 20px;
@ -88,53 +130,83 @@
border-radius: 4px;
border: 1px solid transparent;
white-space: nowrap;
cursor: pointer; }
cursor: pointer;
}
.daterangepicker td.available:hover, .daterangepicker th.available:hover {
background-color: #eee;
border-color: transparent;
color: inherit; }
color: inherit;
}
.daterangepicker td.week, .daterangepicker th.week {
font-size: 80%;
color: #ccc; }
color: #ccc;
}
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
background-color: #fff;
border-color: transparent;
color: #999; }
color: #999;
}
.daterangepicker td.in-range {
background-color: #ebf4f8;
border-color: transparent;
color: #000;
border-radius: 0; }
border-radius: 0;
}
.daterangepicker td.start-date {
border-radius: 4px 0 0 4px; }
border-radius: 4px 0 0 4px;
}
.daterangepicker td.end-date {
border-radius: 0 4px 4px 0; }
border-radius: 0 4px 4px 0;
}
.daterangepicker td.start-date.end-date {
border-radius: 4px; }
border-radius: 4px;
}
.daterangepicker td.active, .daterangepicker td.active:hover {
background-color: #357ebd;
border-color: transparent;
color: #fff; }
color: #fff;
}
.daterangepicker th.month {
width: auto; }
width: auto;
}
.daterangepicker td.disabled, .daterangepicker option.disabled {
color: #999;
cursor: not-allowed;
text-decoration: line-through; }
text-decoration: line-through;
}
.daterangepicker select.monthselect, .daterangepicker select.yearselect {
font-size: 12px;
padding: 1px;
height: auto;
margin: 0;
cursor: default; }
cursor: default;
}
.daterangepicker select.monthselect {
margin-right: 2%;
width: 56%; }
width: 56%;
}
.daterangepicker select.yearselect {
width: 40%; }
width: 40%;
}
.daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect {
width: 50px;
margin-bottom: 0; }
margin-bottom: 0;
}
.daterangepicker .input-mini {
border: 1px solid #ccc;
border-radius: 4px;
@ -145,42 +217,61 @@
vertical-align: middle;
margin: 0 0 5px 0;
padding: 0 6px 0 28px;
width: 100%; }
width: 100%;
}
.daterangepicker .input-mini.active {
border: 1px solid #08c;
border-radius: 4px; }
border-radius: 4px;
}
.daterangepicker .daterangepicker_input {
position: relative; }
position: relative;
}
.daterangepicker .daterangepicker_input i {
position: absolute;
left: 8px;
top: 8px; }
top: 8px;
}
.daterangepicker.rtl .input-mini {
padding-right: 28px;
padding-left: 6px; }
padding-left: 6px;
}
.daterangepicker.rtl .daterangepicker_input i {
left: auto;
right: 8px; }
right: 8px;
}
.daterangepicker .calendar-time {
text-align: center;
margin: 5px auto;
line-height: 30px;
position: relative;
padding-left: 28px; }
padding-left: 28px;
}
.daterangepicker .calendar-time select.disabled {
color: #ccc;
cursor: not-allowed; }
cursor: not-allowed;
}
.ranges {
font-size: 11px;
float: none;
margin: 4px;
text-align: left; }
text-align: left;
}
.ranges ul {
list-style: none;
margin: 0 auto;
padding: 0;
width: 100%; }
width: 100%;
}
.ranges li {
font-size: 13px;
background: #f5f5f5;
@ -189,81 +280,139 @@
color: #08c;
padding: 3px 12px;
margin-bottom: 8px;
cursor: pointer; }
cursor: pointer;
}
.ranges li:hover {
background: #08c;
border: 1px solid #08c;
color: #fff; }
color: #fff;
}
.ranges li.active {
background: #08c;
border: 1px solid #08c;
color: #fff; }
color: #fff;
}
/* Larger Screen Styling */
@media (min-width: 564px) {
.daterangepicker {
width: auto; }
width: auto;
}
.daterangepicker .ranges ul {
width: 160px; }
width: 160px;
}
.daterangepicker.single .ranges ul {
width: 100%; }
width: 100%;
}
.daterangepicker.single .calendar.left {
clear: none; }
clear: none;
}
.daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar {
float: left; }
float: left;
}
.daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar {
float: right; }
float: right;
}
.daterangepicker.ltr {
direction: ltr;
text-align: left; }
text-align: left;
}
.daterangepicker.ltr .calendar.left {
clear: left;
margin-right: 0; }
margin-right: 0;
}
.daterangepicker.ltr .calendar.left .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
border-bottom-right-radius: 0;
}
.daterangepicker.ltr .calendar.right {
margin-left: 0; }
margin-left: 0;
}
.daterangepicker.ltr .calendar.right .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
border-bottom-left-radius: 0;
}
.daterangepicker.ltr .left .daterangepicker_input {
padding-right: 12px; }
padding-right: 12px;
}
.daterangepicker.ltr .calendar.left .calendar-table {
padding-right: 12px; }
padding-right: 12px;
}
.daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar {
float: left; }
float: left;
}
.daterangepicker.rtl {
direction: rtl;
text-align: right; }
text-align: right;
}
.daterangepicker.rtl .calendar.left {
clear: right;
margin-left: 0; }
margin-left: 0;
}
.daterangepicker.rtl .calendar.left .calendar-table {
border-left: none;
border-top-left-radius: 0;
border-bottom-left-radius: 0; }
border-bottom-left-radius: 0;
}
.daterangepicker.rtl .calendar.right {
margin-right: 0; }
margin-right: 0;
}
.daterangepicker.rtl .calendar.right .calendar-table {
border-right: none;
border-top-right-radius: 0;
border-bottom-right-radius: 0; }
border-bottom-right-radius: 0;
}
.daterangepicker.rtl .left .daterangepicker_input {
padding-left: 12px; }
padding-left: 12px;
}
.daterangepicker.rtl .calendar.left .calendar-table {
padding-left: 12px; }
padding-left: 12px;
}
.daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar {
text-align: right;
float: right; } }
float: right;
}
}
@media (min-width: 730px) {
.daterangepicker .ranges {
width: auto; }
width: auto;
}
.daterangepicker.ltr .ranges {
float: left; }
float: left;
}
.daterangepicker.rtl .ranges {
float: right; }
float: right;
}
.daterangepicker .calendar.left {
clear: none !important; } }
clear: none !important;
}
}

View File

@ -25,6 +25,4 @@ $(function () {
pieChart(expenseExpenseUri, 'budget-expense-out');
});

View File

@ -64,7 +64,6 @@ function updateInitialPage() {
}
/**
* Get accountID based on some meta info.
*/

View File

@ -17,5 +17,4 @@
"display": "standalone",
"start_url": "/",
"orientation": "portrait"
}

View File

@ -11,8 +11,6 @@
declare(strict_types=1);
use Illuminate\Http\Request;
/*
|--------------------------------------------------------------------------
| API Routes

View File

@ -394,15 +394,12 @@ Route::group(
Route::post('start/{importJob}', ['uses' => 'ImportController@start', 'as' => 'start']);
//Route::get('settings/{importJob}', ['uses' => 'ImportController@settings', 'as' => 'settings']);
//Route::get('complete/{importJob}', ['uses' => 'ImportController@complete', 'as' => 'complete']);
//Route::get('finished/{importJob}', ['uses' => 'ImportController@finished', 'as' => 'finished']);
//Route::post('settings/{importJob}', ['uses' => 'ImportController@postSettings', 'as' => 'post-settings']);
}
);

View File

@ -126,6 +126,46 @@ class BudgetControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::index
* @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation
* @covers \FireflyIII\Http\Controllers\BudgetController::__construct
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testIndex(string $range)
{
// mock stuff
$budget = factory(Budget::class)->make();
$budgetLimit = factory(BudgetLimit::class)->make();
// set budget limit to current month:
$budgetLimit->start_date = Carbon::now()->startOfMonth();
$budgetLimit->end_date = Carbon::now()->endOfMonth();
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$repository = $this->mock(BudgetRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection);
$repository->shouldReceive('cleanupBudgets');
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
$repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
$repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index'));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::index
* @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation
@ -206,46 +246,6 @@ class BudgetControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::index
* @covers \FireflyIII\Http\Controllers\BudgetController::collectBudgetInformation
* @covers \FireflyIII\Http\Controllers\BudgetController::__construct
* @dataProvider dateRangeProvider
*
* @param string $range
*/
public function testIndex(string $range)
{
// mock stuff
$budget = factory(Budget::class)->make();
$budgetLimit = factory(BudgetLimit::class)->make();
// set budget limit to current month:
$budgetLimit->start_date = Carbon::now()->startOfMonth();
$budgetLimit->end_date = Carbon::now()->endOfMonth();
$accountRepos = $this->mock(AccountRepositoryInterface::class);
$repository = $this->mock(BudgetRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$accountRepos->shouldReceive('getAccountsByType')->andReturn(new Collection);
$repository->shouldReceive('cleanupBudgets');
$repository->shouldReceive('getActiveBudgets')->andReturn(new Collection([$budget]));
$repository->shouldReceive('getInactiveBudgets')->andReturn(new Collection);
$repository->shouldReceive('getAvailableBudget')->andReturn('100.123');
$repository->shouldReceive('spentInPeriod')->andReturn('-1');
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection([$budgetLimit]));
$this->be($this->user());
$this->changeDateRange($this->user(), $range);
$response = $this->get(route('budgets.index'));
$response->assertStatus(200);
// has bread crumb
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\BudgetController::noBudget
* @covers \FireflyIII\Http\Controllers\BudgetController::getPeriodOverview

View File

@ -27,6 +27,24 @@ use Tests\TestCase;
class CurrencyControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/
public function testCannotCreate()
{
// mock stuff
$userRepos = $this->mock(UserRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$userRepos->shouldReceive('hasRole')->once()->andReturn(false);
$this->be($this->user());
$response = $this->get(route('currencies.create'));
$response->assertStatus(302);
$response->assertSessionHas('error');
}
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::delete
*/
@ -70,24 +88,6 @@ class CurrencyControllerTest extends TestCase
$response->assertSessionHas('error');
}
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/
public function testCannotCreate()
{
// mock stuff
$userRepos = $this->mock(UserRepositoryInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$userRepos->shouldReceive('hasRole')->once()->andReturn(false);
$this->be($this->user());
$response = $this->get(route('currencies.create'));
$response->assertStatus(302);
$response->assertSessionHas('error');
}
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::create
*/
@ -236,7 +236,7 @@ class CurrencyControllerTest extends TestCase
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::store
*/
public function testStoreNoRights()
public function testStore()
{
// mock stuff
$repository = $this->mock(CurrencyRepositoryInterface::class);
@ -263,7 +263,7 @@ class CurrencyControllerTest extends TestCase
/**
* @covers \FireflyIII\Http\Controllers\CurrencyController::store
*/
public function testStore()
public function testStoreNoRights()
{
// mock stuff
$repository = $this->mock(CurrencyRepositoryInterface::class);

View File

@ -188,6 +188,7 @@ class ImportControllerTest extends TestCase
$response = $this->post(route('import.start', ['running']));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\ImportController::start
* @expectedExceptionMessage Job did not complete succesfully.

View File

@ -26,20 +26,6 @@ use Tests\TestCase;
*/
class JavascriptControllerTest extends TestCase
{
/**
* @covers \FireflyIII\Http\Controllers\JavascriptController::currencies
*/
public function testCurrencies()
{
$repository = $this->mock(CurrencyRepositoryInterface::class);
$currency = factory(TransactionCurrency::class)->make();
$repository->shouldReceive('get')->andReturn(new Collection([$currency]));
$this->be($this->user());
$response = $this->get(route('javascript.currencies'));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\JavascriptController::accounts
*/
@ -58,6 +44,20 @@ class JavascriptControllerTest extends TestCase
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\JavascriptController::currencies
*/
public function testCurrencies()
{
$repository = $this->mock(CurrencyRepositoryInterface::class);
$currency = factory(TransactionCurrency::class)->make();
$repository->shouldReceive('get')->andReturn(new Collection([$currency]));
$this->be($this->user());
$response = $this->get(route('javascript.currencies'));
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\JavascriptController::variables
* @covers \FireflyIII\Http\Controllers\JavascriptController::getDateRangePicker

View File

@ -13,13 +13,10 @@ namespace Tests\Feature\Controllers\Popup;
use Carbon\Carbon;
use FireflyIII\Helpers\Collector\JournalCollectorInterface;
use FireflyIII\Helpers\Report\PopupReportInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\Budget;
use FireflyIII\Models\Category;
use FireflyIII\Models\Tag;
use FireflyIII\Models\Transaction;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Budget\BudgetRepositoryInterface;
use FireflyIII\Repositories\Category\CategoryRepositoryInterface;

View File

@ -274,22 +274,6 @@ class RuleControllerTest extends TestCase
$response->assertSessionHas('success');
}
/**
* This actually hits an error and not the actually code but OK.
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
public function testTestTriggersError()
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$uri = route('rules.test-triggers');
$response = $this->get($uri);
$response->assertStatus(200);
}
/**
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
@ -319,6 +303,23 @@ class RuleControllerTest extends TestCase
$response->assertStatus(200);
}
/**
* This actually hits an error and not the actually code but OK.
*
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList
*/
public function testTestTriggersError()
{
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$this->be($this->user());
$uri = route('rules.test-triggers');
$response = $this->get($uri);
$response->assertStatus(200);
}
/**
* @covers \FireflyIII\Http\Controllers\RuleController::testTriggers
* @covers \FireflyIII\Http\Controllers\RuleController::getValidTriggerList

View File

@ -177,7 +177,6 @@ class RuleGroupControllerTest extends TestCase
];
$this->be($this->user());
$response = $this->post(route('rule-groups.store', [1]), $data);
$response->assertStatus(302);

View File

@ -151,6 +151,37 @@ class TagControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TagController::show
*/
public function testShowAll()
{
// mock stuff
$repository = $this->mock(TagRepositoryInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$repository->shouldReceive('sumOfTag')->andReturn('1')->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$this->be($this->user());
$response = $this->get(route('tags.show', [1, 'all']));
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TagController::show
*/
@ -185,37 +216,6 @@ class TagControllerTest extends TestCase
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TagController::show
*/
public function testShowAll()
{
// mock stuff
$repository = $this->mock(TagRepositoryInterface::class);
$collector = $this->mock(JournalCollectorInterface::class);
$journalRepos = $this->mock(JournalRepositoryInterface::class);
$journalRepos->shouldReceive('first')->once()->andReturn(new TransactionJournal);
$repository->shouldReceive('firstUseDate')->andReturn(new Carbon)->once();
$collector->shouldReceive('removeFilter')->andReturnSelf()->times(3);
$repository->shouldReceive('sumOfTag')->andReturn('1')->once();
$collector->shouldReceive('setAllAssetAccounts')->andReturnSelf()->times(3);
$collector->shouldReceive('setLimit')->andReturnSelf()->times(3);
$collector->shouldReceive('setPage')->andReturnSelf()->times(3);
$collector->shouldReceive('setTag')->andReturnSelf()->times(3);
$collector->shouldReceive('withOpposingAccount')->andReturnSelf()->times(3);
$collector->shouldReceive('withBudgetInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('withCategoryInformation')->andReturnSelf()->times(3);
$collector->shouldReceive('setRange')->andReturnSelf()->times(3);
$collector->shouldReceive('getPaginatedJournals')->andReturn(new LengthAwarePaginator([], 0, 10))->times(3);
$this->be($this->user());
$response = $this->get(route('tags.show', [1, 'all']));
$response->assertStatus(200);
$response->assertSee('<ol class="breadcrumb">');
}
/**
* @covers \FireflyIII\Http\Controllers\TagController::store
*/

View File

@ -15,8 +15,8 @@ namespace Tests\Unit\Handlers\Events;
use FireflyIII\Events\RegisteredUser;
use FireflyIII\Events\RequestedNewPassword;
use FireflyIII\Handlers\Events\UserEventHandler;
use FireflyIII\Mail\RequestedNewPassword as RequestedNewPasswordMail;
use FireflyIII\Mail\RegisteredUser as RegisteredUserMail;
use FireflyIII\Mail\RequestedNewPassword as RequestedNewPasswordMail;
use FireflyIII\Repositories\User\UserRepositoryInterface;
use Illuminate\Support\Facades\Mail;
use Tests\TestCase;
@ -67,7 +67,8 @@ class UserEventHandlerTest extends TestCase
* @covers \FireflyIII\Handlers\Events\UserEventHandler::sendRegistrationMail
* @covers \FireflyIII\Events\RegisteredUser
*/
public function testSendRegistrationMail() {
public function testSendRegistrationMail()
{
Mail::fake();
$user = $this->emptyUser();
$event = new RegisteredUser($user, '127.0.0.1');

View File

@ -153,7 +153,6 @@ class MetaPieChartTest extends TestCase
$this->assertTrue(true);
}
private function fakeOthers(): Collection