mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-21 11:48:53 +00:00
Upgrade to laravel 5.1
This commit is contained in:
@@ -9,6 +9,7 @@ use League\FactoryMuffin\Facade as FactoryMuffin;
|
||||
*/
|
||||
class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
{
|
||||
protected $baseUrl = 'http://localhost';
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
|
@@ -78,8 +78,8 @@ class AccountControllerTest extends TestCase
|
||||
|
||||
// CURRENCY:
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
$lastActivity = FactoryMuffin::create('FireflyIII\Models\Preference');
|
||||
$lastActivity->data = microtime();
|
||||
@@ -149,8 +149,8 @@ class AccountControllerTest extends TestCase
|
||||
|
||||
// CURRENCY:
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
|
||||
// get edit page:
|
||||
|
@@ -49,8 +49,8 @@ class BillControllerTest extends TestCase
|
||||
|
||||
// CURRENCY:
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
|
||||
$this->call('GET', '/bills/create');
|
||||
@@ -98,8 +98,8 @@ class BillControllerTest extends TestCase
|
||||
|
||||
// CURRENCY:
|
||||
$currency = FactoryMuffin::create('FireflyIII\Models\TransactionCurrency');
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
|
||||
$this->call('GET', '/bills/edit/' . $bill->id);
|
||||
|
@@ -271,7 +271,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
$accounts = $this->mock('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$piggyBanks = $this->mock('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface');
|
||||
$accounts->shouldReceive('leftOnAccount')->andReturn(20);
|
||||
$piggyBanks->shouldReceive('createEvent')->once();
|
||||
|
||||
Amount::shouldReceive('format')->andReturn('something');
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
@@ -310,7 +309,6 @@ class PiggyBankControllerTest extends TestCase
|
||||
$accounts = $this->mock('FireflyIII\Repositories\Account\AccountRepositoryInterface');
|
||||
$piggyBanks = $this->mock('FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface');
|
||||
$accounts->shouldReceive('leftOnAccount')->andReturn(20);
|
||||
$piggyBanks->shouldReceive('createEvent')->once();
|
||||
|
||||
Amount::shouldReceive('format')->andReturn('something');
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('something');
|
||||
|
@@ -56,7 +56,7 @@ class PreferencesControllerTest extends TestCase
|
||||
Preferences::shouldReceive('get')->once()->withArgs(['viewRange', '1M'])->andReturn($pref);
|
||||
Preferences::shouldReceive('get')->once()->withArgs(['frontPageAccounts', []])->andReturn($pref);
|
||||
Preferences::shouldReceive('get')->once()->withArgs(['budgetMaximum', 1000])->andReturn($pref);
|
||||
Preferences::shouldReceive('get')->once()->withArgs(['currencyPreference', 'EUR'])->andReturn($pref);
|
||||
Preferences::shouldReceive('get')->withArgs(['currencyPreference', 'EUR'])->andReturn($pref);
|
||||
Amount::shouldReceive('format')->andReturn('xx');
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn(new Collection);
|
||||
|
@@ -158,10 +158,10 @@ class ReportControllerTest extends TestCase
|
||||
$helper->shouldReceive('getExpenseReport')->once()->withAnyArgs()->andReturn([]);
|
||||
|
||||
// mock stuff!
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->once()->andReturn('X');
|
||||
Amount::shouldReceive('getCurrencySymbol')->once()->andReturn('X');
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
Amount::shouldReceive('getCurrencySymbol')->andReturn('X');
|
||||
Amount::shouldReceive('format')->andReturn('X');
|
||||
|
||||
$this->call('GET', '/reports/2015/shared');
|
||||
|
@@ -244,8 +244,8 @@ class TransactionControllerTest extends TestCase
|
||||
|
||||
// fake!
|
||||
$repository->shouldReceive('getAmountBefore')->withAnyArgs()->andReturn(5);
|
||||
Amount::shouldReceive('getDefaultCurrency')->once()->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->once()->andReturn([$currency]);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
Amount::shouldReceive('getCurrencyCode')->andReturn('X');
|
||||
Amount::shouldReceive('formatTransaction')->andReturn('X');
|
||||
Amount::shouldReceive('format')->andReturn('X');
|
||||
|
Reference in New Issue
Block a user