Upgrade to laravel 5.1

This commit is contained in:
James Cole
2015-06-11 21:19:40 +02:00
parent 0587d96474
commit b1b03a4325
15 changed files with 288 additions and 266 deletions

View File

@@ -9,6 +9,7 @@ use League\FactoryMuffin\Facade as FactoryMuffin;
*/
class TestCase extends Illuminate\Foundation\Testing\TestCase
{
protected $baseUrl = 'http://localhost';
/**
* Creates the application.

View File

@@ -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:

View File

@@ -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);

View File

@@ -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');

View File

@@ -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);

View File

@@ -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');

View File

@@ -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');