/** * @covers FireflyIII\Support\Amount::getDefaultCurrency */ public function testGetDefaultCurrency() { // will the the euro: $eur = TransactionCurrency::whereCode('EUR')->first(); $result = $this->object->getDefaultCurrency(); $this->assertEquals($eur->id, $result->id); }
/** * @param $name * @param null $value * @param array $options * * @return string */ public function balance($name, $value = null, array $options = []) { $label = $this->label($name, $options); $options = $this->expandOptionArray($name, $label, $options); $classes = $this->getHolderClasses($name); $value = $this->fillFieldValue($name, $value); $options['step'] = 'any'; $defaultCurrency = isset($options['currency']) ? $options['currency'] : Amt::getDefaultCurrency(); $currencies = Amt::getAllCurrencies(); unset($options['currency']); unset($options['placeholder']); $html = view('form.balance', compact('defaultCurrency', 'currencies', 'classes', 'name', 'label', 'value', 'options'))->render(); return $html; }