mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Tests now run without a database, as they should.
This commit is contained in:
parent
36ec974284
commit
720926c50d
@ -6,6 +6,7 @@ use Cache;
|
||||
use FireflyIII\Models\Transaction;
|
||||
use FireflyIII\Models\TransactionCurrency;
|
||||
use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Support\Collection;
|
||||
use Preferences as Prefs;
|
||||
|
||||
/**
|
||||
@ -134,6 +135,14 @@ class Amount
|
||||
return $this->formatWithSymbol($symbol, $amount, $coloured);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection
|
||||
*/
|
||||
public function getAllCurrencies()
|
||||
{
|
||||
return TransactionCurrency::orderBy('code', 'ASC')->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
@ -34,7 +34,7 @@ class ExpandedForm
|
||||
$options['step'] = 'any';
|
||||
$options['min'] = '0.01';
|
||||
$defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency();
|
||||
$currencies = TransactionCurrency::orderBy('code', 'ASC')->get();
|
||||
$currencies = Amt::getAllCurrencies();
|
||||
$html = View::make('form.amount', compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
|
||||
|
||||
return $html;
|
||||
@ -145,7 +145,7 @@ class ExpandedForm
|
||||
$value = $this->fillFieldValue($name, $value);
|
||||
$options['step'] = 'any';
|
||||
$defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency();
|
||||
$currencies = TransactionCurrency::orderBy('code', 'ASC')->get();
|
||||
$currencies = Amt::getAllCurrencies();
|
||||
$html = View::make('form.balance', compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render();
|
||||
|
||||
return $html;
|
||||
|
@ -14,7 +14,6 @@ class AccountControllerTest extends TestCase
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
Artisan::call('migrate');
|
||||
|
||||
|
||||
}
|
||||
@ -42,6 +41,8 @@ class AccountControllerTest extends TestCase
|
||||
|
||||
Preferences::shouldReceive('get', 'viewRange')->andReturn($pref);
|
||||
Amount::shouldReceive('getDefaultCurrency')->andReturn($currency);
|
||||
Amount::shouldReceive('getAllCurrencies')->andReturn([$currency]);
|
||||
// get all currencires?
|
||||
|
||||
$response = $this->call('GET', '/accounts/create/asset');
|
||||
$this->assertResponseOk();
|
||||
|
Loading…
Reference in New Issue
Block a user