mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 19:01:58 +00:00
Fixed some tests.
This commit is contained in:
@@ -95,11 +95,6 @@ $(function () {
|
|||||||
$('input[type="number"]').on('input', updateBudgetedAmounts);
|
$('input[type="number"]').on('input', updateBudgetedAmounts);
|
||||||
|
|
||||||
|
|
||||||
//updateRanges();
|
|
||||||
//$('input[type="range"]').on('input', updateSingleRange);
|
|
||||||
//$('input[type="number"]').on('input', updateSingleRange);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Draw the charts, if necessary:
|
Draw the charts, if necessary:
|
||||||
*/
|
*/
|
||||||
@@ -112,87 +107,7 @@ $(function () {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function updateIncome() {
|
||||||
//function updateSingleRange(e) {
|
|
||||||
// "use strict";
|
|
||||||
// // get some values:
|
|
||||||
// var input = $(e.target);
|
|
||||||
// var id = input.data('id');
|
|
||||||
// var value = parseInt(input.val());
|
|
||||||
// var spent = parseFloat($('#spent-' + id).data('value'));
|
|
||||||
//
|
|
||||||
// // update small display:
|
|
||||||
// if (value > 0) {
|
|
||||||
// // show the input:
|
|
||||||
// $('#budget-info-' + id + ' span').show();
|
|
||||||
// $('#budget-info-' + id + ' input').show();
|
|
||||||
//
|
|
||||||
// // update the text:
|
|
||||||
// $('#budget-description-' + id).text('Budgeted: ');
|
|
||||||
// } else {
|
|
||||||
// // hide the input:
|
|
||||||
// $('#budget-info-' + id + ' span').hide();
|
|
||||||
// $('#budget-info-' + id + ' input').hide();
|
|
||||||
//
|
|
||||||
// // update the text:
|
|
||||||
// $('#budget-description-' + id).html('<em>No budget</em>');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // update the range display text:
|
|
||||||
// $('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));
|
|
||||||
//
|
|
||||||
// // send a post to Firefly to update the amount:
|
|
||||||
// $.post('budgets/amount/' + id, {amount: value, _token: token}).success(function (data) {
|
|
||||||
// // update the link if relevant:
|
|
||||||
// $('#budget-link-' + id).attr('href', 'budgets/show/' + id + '/' + data.repetition);
|
|
||||||
// });
|
|
||||||
// if (input.attr('type') === 'number') {
|
|
||||||
// // update the range-input:
|
|
||||||
// $('#budget-range-' + id).val(value);
|
|
||||||
// } else {
|
|
||||||
// // update the number-input:
|
|
||||||
// $('#budget-info-' + id + ' input').val(value);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // update or hide the bar, whichever is necessary.
|
|
||||||
// updateTotal();
|
|
||||||
// return value;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//function updateTotal() {
|
|
||||||
// "use strict";
|
|
||||||
// var sum = 0;
|
|
||||||
// $('input[type="range"]').each(function (i, v) {
|
|
||||||
// // get some values:
|
|
||||||
// sum += parseInt($(v).val());
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Update total sum:
|
|
||||||
// */
|
|
||||||
// var totalAmount = parseInt($('#totalAmount').data('value'));
|
|
||||||
// var pct;
|
|
||||||
// if (sum <= totalAmount) {
|
|
||||||
// pct = sum / totalAmount * 100;
|
|
||||||
// $('#progress-bar-default').css('width', pct + '%');
|
|
||||||
// $('#progress-bar-warning').css('width', '0');
|
|
||||||
// $('#progress-bar-danger').css('width', '0');
|
|
||||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-success').removeClass('text-danger');
|
|
||||||
// } else {
|
|
||||||
// // we gaan er X overheen,
|
|
||||||
//
|
|
||||||
// pct = totalAmount / sum * 100;
|
|
||||||
// var danger = 100 - pct;
|
|
||||||
// var err = 100 - danger;
|
|
||||||
// $('#progress-bar-default').css('width', 0);
|
|
||||||
// $('#progress-bar-warning').css('width', err + '%');
|
|
||||||
// $('#progress-bar-danger').css('width', danger + '%');
|
|
||||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-danger').removeClass('text-success');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
function updateIncome(e) {
|
|
||||||
"use strict";
|
"use strict";
|
||||||
$('#defaultModal').empty().load('budgets/income', function () {
|
$('#defaultModal').empty().load('budgets/income', function () {
|
||||||
$('#defaultModal').modal('show');
|
$('#defaultModal').modal('show');
|
||||||
@@ -200,51 +115,3 @@ function updateIncome(e) {
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
//function updateRanges() {
|
|
||||||
// "use strict";
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// var sum = 0;
|
|
||||||
// $('input[type="range"]').each(function (i, v) {
|
|
||||||
// // get some values:
|
|
||||||
// var input = $(v);
|
|
||||||
// var id = input.data('id');
|
|
||||||
// var value = parseInt(input.val());
|
|
||||||
//
|
|
||||||
// // calculate sum:
|
|
||||||
// sum += value;
|
|
||||||
//
|
|
||||||
// // update small display:
|
|
||||||
// $('#budget-range-display-' + id).text('\u20AC ' + value.toFixed(2));
|
|
||||||
//
|
|
||||||
// // send a post to Firefly to update the amount:
|
|
||||||
// $.post('budgets/amount/' + id, {amount: value, _token: token});
|
|
||||||
//
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * Update total sum:
|
|
||||||
// */
|
|
||||||
// var totalAmount = parseInt($('#totalAmount').data('value'));
|
|
||||||
// var pct;
|
|
||||||
// if (sum <= totalAmount) {
|
|
||||||
// pct = sum / totalAmount * 100;
|
|
||||||
// $('#progress-bar-default').css('width', pct + '%');
|
|
||||||
// $('#progress-bar-warning').css('width', '0');
|
|
||||||
// $('#progress-bar-danger').css('width', '0');
|
|
||||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-success').removeClass('text-danger');
|
|
||||||
// } else {
|
|
||||||
// // we gaan er X overheen,
|
|
||||||
//
|
|
||||||
// pct = totalAmount / sum * 100;
|
|
||||||
// var danger = 100 - pct;
|
|
||||||
// var err = 100 - danger;
|
|
||||||
// $('#progress-bar-default').css('width', 0);
|
|
||||||
// $('#progress-bar-warning').css('width', err + '%');
|
|
||||||
// $('#progress-bar-danger').css('width', danger + '%');
|
|
||||||
// $('#budgetedAmount').text('\u20AC ' + sum.toFixed(2)).addClass('text-danger').removeClass('text-success');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//}
|
|
@@ -81,6 +81,7 @@ class AccountControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||||
$lastActivity->data = microtime();
|
$lastActivity->data = microtime();
|
||||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||||
@@ -152,6 +153,7 @@ class AccountControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
// get edit page:
|
// get edit page:
|
||||||
$this->call('GET', '/accounts/edit/' . $this->account->id);
|
$this->call('GET', '/accounts/edit/' . $this->account->id);
|
||||||
@@ -182,6 +184,7 @@ class AccountControllerTest extends TestCase
|
|||||||
|
|
||||||
Amount::shouldReceive('format')->andReturn('');
|
Amount::shouldReceive('format')->andReturn('');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('A');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('A');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
|
|
||||||
// put stuff in session:
|
// put stuff in session:
|
||||||
@@ -204,6 +207,7 @@ class AccountControllerTest extends TestCase
|
|||||||
|
|
||||||
// mock!
|
// mock!
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('A');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('A');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
$repository = $this->mock('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
$repository = $this->mock('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||||
$repository->shouldReceive('getJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
$repository->shouldReceive('getJournals')->andReturn(new LengthAwarePaginator([], 0, 10));
|
||||||
|
|
||||||
|
@@ -52,6 +52,7 @@ class BillControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('GET', '/bills/create');
|
$this->call('GET', '/bills/create');
|
||||||
$this->assertViewHas('subTitle', 'Create new bill');
|
$this->assertViewHas('subTitle', 'Create new bill');
|
||||||
@@ -101,6 +102,7 @@ class BillControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('GET', '/bills/edit/' . $bill->id);
|
$this->call('GET', '/bills/edit/' . $bill->id);
|
||||||
$this->assertViewHas('subTitle', 'Edit bill "' . e($bill->name) . '"');
|
$this->assertViewHas('subTitle', 'Edit bill "' . e($bill->name) . '"');
|
||||||
@@ -120,6 +122,7 @@ class BillControllerTest extends TestCase
|
|||||||
|
|
||||||
Amount::shouldReceive('format')->andReturn('XX');
|
Amount::shouldReceive('format')->andReturn('XX');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$repository = $this->mock('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
$repository = $this->mock('FireflyIII\Repositories\Bill\BillRepositoryInterface');
|
||||||
$repository->shouldReceive('getBills')->once()->andReturn($collection);
|
$repository->shouldReceive('getBills')->once()->andReturn($collection);
|
||||||
@@ -190,6 +193,7 @@ class BillControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('format')->andReturn('XX');
|
Amount::shouldReceive('format')->andReturn('XX');
|
||||||
Amount::shouldReceive('formatJournal')->andReturn('XX');
|
Amount::shouldReceive('formatJournal')->andReturn('XX');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('XX');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('XX');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
|
|
||||||
$this->call('GET', '/bills/show/' . $bill->id);
|
$this->call('GET', '/bills/show/' . $bill->id);
|
||||||
|
@@ -156,6 +156,7 @@ class BudgetControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('x');
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('x');
|
||||||
Amount::shouldReceive('format')->andReturn('x');
|
Amount::shouldReceive('format')->andReturn('x');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
$this->call('GET', '/budgets');
|
$this->call('GET', '/budgets');
|
||||||
|
|
||||||
@@ -221,6 +222,7 @@ class BudgetControllerTest extends TestCase
|
|||||||
$paginator = new LengthAwarePaginator(new Collection, 0, 20, 1);
|
$paginator = new LengthAwarePaginator(new Collection, 0, 20, 1);
|
||||||
|
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('format')->andReturn('x');
|
Amount::shouldReceive('format')->andReturn('x');
|
||||||
$repository->shouldReceive('getJournals')->andReturn($paginator);
|
$repository->shouldReceive('getJournals')->andReturn($paginator);
|
||||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
||||||
@@ -247,6 +249,7 @@ class BudgetControllerTest extends TestCase
|
|||||||
$this->be($otherBudget->user);
|
$this->be($otherBudget->user);
|
||||||
|
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('format')->andReturn('x');
|
Amount::shouldReceive('format')->andReturn('x');
|
||||||
$repository->shouldReceive('getJournals')->andReturn(new Collection);
|
$repository->shouldReceive('getJournals')->andReturn(new Collection);
|
||||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
||||||
@@ -271,6 +274,7 @@ class BudgetControllerTest extends TestCase
|
|||||||
$paginator = new LengthAwarePaginator(new Collection, 0, 20, 1);
|
$paginator = new LengthAwarePaginator(new Collection, 0, 20, 1);
|
||||||
|
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('x');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('format')->andReturn('x');
|
Amount::shouldReceive('format')->andReturn('x');
|
||||||
$repository->shouldReceive('getJournals')->andReturn($paginator);
|
$repository->shouldReceive('getJournals')->andReturn($paginator);
|
||||||
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
$repository->shouldReceive('getBudgetLimits')->andReturn(new Collection);
|
||||||
@@ -412,6 +416,7 @@ class BudgetControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||||
$lastActivity->data = microtime();
|
$lastActivity->data = microtime();
|
||||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||||
|
@@ -107,6 +107,7 @@ class CategoryControllerTest extends TestCase
|
|||||||
$collection->push($category);
|
$collection->push($category);
|
||||||
|
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('xx');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('xx');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
$repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||||
$repository->shouldReceive('getCategories')->andReturn($collection);
|
$repository->shouldReceive('getCategories')->andReturn($collection);
|
||||||
@@ -129,6 +130,7 @@ class CategoryControllerTest extends TestCase
|
|||||||
|
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('xx');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('xx');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
|
|
||||||
$repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
$repository = $this->mock('FireflyIII\Repositories\Category\CategoryRepositoryInterface');
|
||||||
@@ -159,6 +161,7 @@ class CategoryControllerTest extends TestCase
|
|||||||
|
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('xx');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('xx');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('formatJournal')->andReturn('xx');
|
Amount::shouldReceive('formatJournal')->andReturn('xx');
|
||||||
|
|
||||||
$this->call('GET', '/categories/show/' . $category->id);
|
$this->call('GET', '/categories/show/' . $category->id);
|
||||||
|
@@ -119,6 +119,7 @@ class HomeControllerTest extends TestCase
|
|||||||
|
|
||||||
|
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('EUR');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('EUR');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('format')->andReturn('xxx');
|
Amount::shouldReceive('format')->andReturn('xxx');
|
||||||
Amount::shouldReceive('formatJournal')->with($journal)->andReturn('xxx');
|
Amount::shouldReceive('formatJournal')->with($journal)->andReturn('xxx');
|
||||||
|
|
||||||
|
@@ -61,6 +61,7 @@ class JsonControllerTest extends TestCase
|
|||||||
$accounts->shouldReceive('getTransfersInRange')->andReturn(new Collection);
|
$accounts->shouldReceive('getTransfersInRange')->andReturn(new Collection);
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Steam::shouldReceive('balance')->andReturn(0);
|
Steam::shouldReceive('balance')->andReturn(0);
|
||||||
|
|
||||||
|
|
||||||
@@ -92,6 +93,7 @@ class JsonControllerTest extends TestCase
|
|||||||
$accounts->shouldReceive('getCreditCards')->andReturn($ccs);
|
$accounts->shouldReceive('getCreditCards')->andReturn($ccs);
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Steam::shouldReceive('balance')->andReturn(-1);
|
Steam::shouldReceive('balance')->andReturn(-1);
|
||||||
|
|
||||||
$this->call('GET', '/json/box/bills-unpaid');
|
$this->call('GET', '/json/box/bills-unpaid');
|
||||||
@@ -110,6 +112,7 @@ class JsonControllerTest extends TestCase
|
|||||||
$repository->shouldReceive('incomeInPeriodCorrected')->andReturn(new Collection);
|
$repository->shouldReceive('incomeInPeriodCorrected')->andReturn(new Collection);
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('GET', '/json/box/in');
|
$this->call('GET', '/json/box/in');
|
||||||
$this->assertResponseOk();
|
$this->assertResponseOk();
|
||||||
@@ -127,6 +130,7 @@ class JsonControllerTest extends TestCase
|
|||||||
$repository->shouldReceive('expenseInPeriodCorrected')->andReturn(new Collection);
|
$repository->shouldReceive('expenseInPeriodCorrected')->andReturn(new Collection);
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('GET', '/json/box/out');
|
$this->call('GET', '/json/box/out');
|
||||||
$this->assertResponseOk();
|
$this->assertResponseOk();
|
||||||
|
@@ -47,6 +47,8 @@ class NewUserControllerTest extends TestCase
|
|||||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||||
$lastActivity->data = microtime();
|
$lastActivity->data = microtime();
|
||||||
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
Preferences::shouldReceive('lastActivity')->andReturn($lastActivity);
|
||||||
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('GET', '/new-user');
|
$this->call('GET', '/new-user');
|
||||||
$this->assertResponseStatus(200);
|
$this->assertResponseStatus(200);
|
||||||
|
@@ -58,6 +58,7 @@ class PiggyBankControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('format')->andReturn('XXxx');
|
Amount::shouldReceive('format')->andReturn('XXxx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('GET', '/piggy-banks/add/' . $piggyBank->id);
|
$this->call('GET', '/piggy-banks/add/' . $piggyBank->id);
|
||||||
$this->assertResponseOk();
|
$this->assertResponseOk();
|
||||||
@@ -208,6 +209,7 @@ class PiggyBankControllerTest extends TestCase
|
|||||||
$accounts->shouldReceive('leftOnAccount')->andReturn(12);
|
$accounts->shouldReceive('leftOnAccount')->andReturn(12);
|
||||||
Amount::shouldReceive('format')->andReturn('123');
|
Amount::shouldReceive('format')->andReturn('123');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
|
|
||||||
$this->call('GET', '/piggy-banks');
|
$this->call('GET', '/piggy-banks');
|
||||||
@@ -254,6 +256,7 @@ class PiggyBankControllerTest extends TestCase
|
|||||||
|
|
||||||
Amount::shouldReceive('format')->andReturn('something');
|
Amount::shouldReceive('format')->andReturn('something');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('POST', '/piggy-banks/add/' . $piggyBank->id, ['_token' => 'replaceMe']);
|
$this->call('POST', '/piggy-banks/add/' . $piggyBank->id, ['_token' => 'replaceMe']);
|
||||||
$this->assertResponseStatus(302);
|
$this->assertResponseStatus(302);
|
||||||
@@ -273,6 +276,7 @@ class PiggyBankControllerTest extends TestCase
|
|||||||
|
|
||||||
Amount::shouldReceive('format')->andReturn('something');
|
Amount::shouldReceive('format')->andReturn('something');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
|
|
||||||
$this->call('POST', '/piggy-banks/add/' . $piggyBank->id, ['_token' => 'replaceMe', 'amount' => '10000']);
|
$this->call('POST', '/piggy-banks/add/' . $piggyBank->id, ['_token' => 'replaceMe', 'amount' => '10000']);
|
||||||
$this->assertResponseStatus(302);
|
$this->assertResponseStatus(302);
|
||||||
|
@@ -59,6 +59,7 @@ class PreferencesControllerTest extends TestCase
|
|||||||
Preferences::shouldReceive('get')->withArgs(['currencyPreference', 'EUR'])->andReturn($pref);
|
Preferences::shouldReceive('get')->withArgs(['currencyPreference', 'EUR'])->andReturn($pref);
|
||||||
Amount::shouldReceive('format')->andReturn('xx');
|
Amount::shouldReceive('format')->andReturn('xx');
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('getAllCurrencies')->andReturn(new Collection);
|
Amount::shouldReceive('getAllCurrencies')->andReturn(new Collection);
|
||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
|
|
||||||
|
@@ -339,6 +339,7 @@ class TransactionControllerTest extends TestCase
|
|||||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||||
|
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||||
Amount::shouldReceive('formatTransaction')->andReturn('X');
|
Amount::shouldReceive('formatTransaction')->andReturn('X');
|
||||||
Amount::shouldReceive('format')->andReturn('X');
|
Amount::shouldReceive('format')->andReturn('X');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user