Fixed transaction coverage.

This commit is contained in:
James Cole 2015-01-01 22:51:38 +01:00
parent fa1695672a
commit 05ea8216ff
4 changed files with 10 additions and 7 deletions

View File

@ -5,6 +5,8 @@ League\FactoryMuffin\Facade::define(
'account_id' => 'factory|Account',
'transaction_journal_id' => 'factory|TransactionJournal',
'description' => 'sentence',
'amount' => 'numberBetween:1,100',
'amount' => function() {
return round(rand(100,10000) / 100,2);
}
]
);

View File

@ -40,7 +40,9 @@
"sebastian/phpdcd": "*",
"codeception/phpbuiltinserver": "*",
"codeception/specify": "*",
"codeception/verify": "*"
"codeception/verify": "*",
"fzaninotto/faker": "1.*"
},
"autoload": {

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "66a93b738537ed20455648f477585c88",
"hash": "3ac71ef711586f9c2bf7c36482284a13",
"packages": [
{
"name": "classpreloader/classpreloader",

View File

@ -46,16 +46,15 @@ class TransactionTest extends TestCase
{
$transaction = f::create('Transaction');
$amount = floatval($transaction->amount);
$amount--;
$this->assertCount(1, Transaction::moreThan($amount)->get());
$amount++;
$this->assertCount(1, Transaction::lessThan($amount)->get());
}
public function testMoreThan()
{
$transaction = f::create('Transaction');
$amount = floatval($transaction->amount);
$amount++;
$amount--;
$this->assertCount(1, Transaction::moreThan($amount)->get());
}