mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
This should fix the tests on the translations branch.
This commit is contained in:
@@ -141,11 +141,19 @@ class BudgetControllerTest extends TestCase
|
||||
|
||||
public function testPostUpdateIncome()
|
||||
{
|
||||
|
||||
|
||||
$budget = FactoryMuffin::create('FireflyIII\Models\Budget');
|
||||
$this->be($budget->user);
|
||||
$date = Carbon::now()->startOfMonth()->format('FY');
|
||||
Preferences::shouldReceive('set')->once()->withArgs(['budgetIncomeTotal' . $date, 1001]);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
$this->call('POST', '/budgets/income', ['_token' => 'replaceme', 'amount' => 1001]);
|
||||
$this->assertResponseStatus(302);
|
||||
$this->assertRedirectedToRoute('budgets.index');
|
||||
@@ -311,6 +319,12 @@ class BudgetControllerTest extends TestCase
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
$this->call('GET', '/budgets/income');
|
||||
$this->assertResponseOk();
|
||||
|
@@ -317,6 +317,12 @@ class GoogleChartControllerTest extends TestCase
|
||||
$repository->shouldReceive('journalsByExpenseAccount')->andReturn($journals);
|
||||
Preferences::shouldReceive('get')->withArgs(['showSharedReports', false])->once()->andReturn($preference);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
$this->call('GET', '/chart/reports/income-expenses/2015');
|
||||
$this->assertResponseOk();
|
||||
@@ -340,6 +346,12 @@ class GoogleChartControllerTest extends TestCase
|
||||
$repository->shouldReceive('journalsByExpenseAccount')->andReturn($journals);
|
||||
Preferences::shouldReceive('get')->withArgs(['showSharedReports', false])->once()->andReturn($preference);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
$this->call('GET', '/chart/reports/income-expenses-sum/2015');
|
||||
}
|
||||
|
@@ -102,6 +102,12 @@ class HomeControllerTest extends TestCase
|
||||
$repository->shouldReceive('sumOfEverything')->once()->andReturn(1);
|
||||
$repository->shouldReceive('getFrontpageTransactions')->once()->andReturn($journals);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('EUR');
|
||||
Amount::shouldReceive('format')->andReturn('xxx');
|
||||
|
@@ -187,6 +187,12 @@ class JsonControllerTest extends TestCase
|
||||
Preferences::shouldReceive('get')->withArgs(['showSharedReports', false])->andReturn($pref);
|
||||
Preferences::shouldReceive('set')->withArgs(['showSharedReports', true]);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
$this->call('GET', '/json/show-shared-reports/set');
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
@@ -202,6 +208,12 @@ class JsonControllerTest extends TestCase
|
||||
|
||||
Preferences::shouldReceive('get')->withArgs(['showSharedReports', false])->andReturn($pref);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
$this->call('GET', '/json/show-shared-reports');
|
||||
$this->assertResponseOk();
|
||||
|
@@ -59,6 +59,12 @@ class PreferencesControllerTest extends TestCase
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn(new Collection);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
$this->call('GET', '/preferences');
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
@@ -78,6 +84,12 @@ class PreferencesControllerTest extends TestCase
|
||||
Preferences::shouldReceive('set')->once()->withArgs(['viewRange', '1M']);
|
||||
Preferences::shouldReceive('set')->once()->withArgs(['budgetMaximum', 0]);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
$this->call('POST', '/preferences', $data);
|
||||
$this->assertResponseStatus(302);
|
||||
|
@@ -65,6 +65,12 @@ class ReportControllerTest extends TestCase
|
||||
$query->shouldReceive('balancedTransactionsSum')->withAnyArgs()->andReturn(100);
|
||||
$helper->shouldReceive('getBudgetsForMonth')->withAnyArgs()->andReturn($budgets);
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
|
||||
$this->call('GET', '/reports/budget/2015/1');
|
||||
$this->assertResponseOk();
|
||||
@@ -203,6 +209,12 @@ class ReportControllerTest extends TestCase
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||
Amount::shouldReceive('format')->andReturn('X');
|
||||
|
||||
// language preference:
|
||||
$language = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$language->data = 'en';
|
||||
$language->save();
|
||||
Preferences::shouldReceive('get')->withAnyArgs()->andReturn($language);
|
||||
|
||||
$this->call('GET', '/reports/2015/1');
|
||||
$this->assertResponseOk();
|
||||
}
|
||||
|
Reference in New Issue
Block a user