mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-30 10:33:30 +00:00
Fix tests.
This commit is contained in:
@@ -88,7 +88,7 @@ class Amount implements ConverterInterface
|
|||||||
Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $oldValue, $value));
|
Log::debug(sprintf('No decimal character found. Converted amount from "%s" to "%s".', $oldValue, $value));
|
||||||
}
|
}
|
||||||
|
|
||||||
$number = strval(number_format(round(floatval($value), 12), 12,'',''));
|
$number = strval(number_format(round(floatval($value), 12), 12,'.',''));
|
||||||
return $number;
|
return $number;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,10 +40,6 @@ class AccountType extends Model
|
|||||||
const IMPORT = 'Import account';
|
const IMPORT = 'Import account';
|
||||||
const RECONCILIATION = 'Reconciliation account';
|
const RECONCILIATION = 'Reconciliation account';
|
||||||
const LOAN = 'Loan';
|
const LOAN = 'Loan';
|
||||||
|
|
||||||
/** @var array */
|
|
||||||
protected $fillable = ['type'];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be casted to native types.
|
* The attributes that should be casted to native types.
|
||||||
*
|
*
|
||||||
@@ -54,6 +50,8 @@ class AccountType extends Model
|
|||||||
'created_at' => 'datetime',
|
'created_at' => 'datetime',
|
||||||
'updated_at' => 'datetime',
|
'updated_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
/** @var array */
|
||||||
|
protected $fillable = ['type'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HasMany
|
* @return HasMany
|
||||||
|
@@ -38,10 +38,6 @@ class TransactionType extends Model
|
|||||||
const TRANSFER = 'Transfer';
|
const TRANSFER = 'Transfer';
|
||||||
const OPENING_BALANCE = 'Opening balance';
|
const OPENING_BALANCE = 'Opening balance';
|
||||||
const RECONCILIATION = 'Reconciliation';
|
const RECONCILIATION = 'Reconciliation';
|
||||||
|
|
||||||
/** @var array */
|
|
||||||
protected $fillable = ['type'];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be casted to native types.
|
* The attributes that should be casted to native types.
|
||||||
*
|
*
|
||||||
@@ -53,6 +49,8 @@ class TransactionType extends Model
|
|||||||
'updated_at' => 'datetime',
|
'updated_at' => 'datetime',
|
||||||
'deleted_at' => 'datetime',
|
'deleted_at' => 'datetime',
|
||||||
];
|
];
|
||||||
|
/** @var array */
|
||||||
|
protected $fillable = ['type'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $type
|
* @param string $type
|
||||||
|
@@ -88,7 +88,7 @@ class AmountTest extends TestCase
|
|||||||
foreach ($values as $value => $expected) {
|
foreach ($values as $value => $expected) {
|
||||||
$converter = new Amount;
|
$converter = new Amount;
|
||||||
$result = $converter->convert($value);
|
$result = $converter->convert($value);
|
||||||
$this->assertEquals($expected, $result);
|
$this->assertEquals($expected, $result,sprintf('The original value was %s', $value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user