From 4e6b78220451d696dd8ee185d545b05c5a966ec6 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 22 Nov 2017 20:30:23 +0100 Subject: [PATCH] Fix tests. --- app/Import/Converter/Amount.php | 2 +- app/Models/AccountType.php | 6 ++---- app/Models/TransactionType.php | 6 ++---- tests/Unit/Import/Converter/AmountTest.php | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/app/Import/Converter/Amount.php b/app/Import/Converter/Amount.php index 4791c4e3c3..f5e6420963 100644 --- a/app/Import/Converter/Amount.php +++ b/app/Import/Converter/Amount.php @@ -88,7 +88,7 @@ class Amount implements ConverterInterface 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; } } diff --git a/app/Models/AccountType.php b/app/Models/AccountType.php index 1ba108a8ce..66eb903b65 100644 --- a/app/Models/AccountType.php +++ b/app/Models/AccountType.php @@ -40,10 +40,6 @@ class AccountType extends Model const IMPORT = 'Import account'; const RECONCILIATION = 'Reconciliation account'; const LOAN = 'Loan'; - - /** @var array */ - protected $fillable = ['type']; - /** * The attributes that should be casted to native types. * @@ -54,6 +50,8 @@ class AccountType extends Model 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; + /** @var array */ + protected $fillable = ['type']; /** * @return HasMany diff --git a/app/Models/TransactionType.php b/app/Models/TransactionType.php index 9668384b2f..f8c5274226 100644 --- a/app/Models/TransactionType.php +++ b/app/Models/TransactionType.php @@ -38,10 +38,6 @@ class TransactionType extends Model const TRANSFER = 'Transfer'; const OPENING_BALANCE = 'Opening balance'; const RECONCILIATION = 'Reconciliation'; - - /** @var array */ - protected $fillable = ['type']; - /** * The attributes that should be casted to native types. * @@ -53,6 +49,8 @@ class TransactionType extends Model 'updated_at' => 'datetime', 'deleted_at' => 'datetime', ]; + /** @var array */ + protected $fillable = ['type']; /** * @param string $type diff --git a/tests/Unit/Import/Converter/AmountTest.php b/tests/Unit/Import/Converter/AmountTest.php index 3cc08e4a25..7209e3857d 100644 --- a/tests/Unit/Import/Converter/AmountTest.php +++ b/tests/Unit/Import/Converter/AmountTest.php @@ -88,7 +88,7 @@ class AmountTest extends TestCase foreach ($values as $value => $expected) { $converter = new Amount; $result = $converter->convert($value); - $this->assertEquals($expected, $result); + $this->assertEquals($expected, $result,sprintf('The original value was %s', $value)); } }