mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-03 20:14:31 +00:00
Fix tests.
This commit is contained in:
@@ -68,44 +68,6 @@ class BillTransformerTest extends TestCase
|
||||
$this->assertTrue($result['active']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Basic coverage with a note.
|
||||
*
|
||||
* @covers \FireflyIII\Transformers\BillTransformer::transform
|
||||
*/
|
||||
public function testNote(): void
|
||||
{
|
||||
|
||||
$bill = Bill::create(
|
||||
[
|
||||
'user_id' => $this->user()->id,
|
||||
'name' => 'Some bill ' . random_int(1, 10000),
|
||||
'match' => 'word,' . random_int(1, 10000),
|
||||
'amount_min' => 12.34,
|
||||
'amount_max' => 45.67,
|
||||
'date' => '2018-01-02',
|
||||
'transaction_currency_id' => 1,
|
||||
'repeat_freq' => 'weekly',
|
||||
'skip' => 0,
|
||||
'active' => 1,
|
||||
]
|
||||
);
|
||||
$noteText = 'I are a note ' . random_int(1, 10000);
|
||||
Note::create(
|
||||
[
|
||||
'noteable_id' => $bill->id,
|
||||
'noteable_type' => Bill::class,
|
||||
'text' => $noteText,
|
||||
]
|
||||
);
|
||||
$transformer = new BillTransformer(new ParameterBag);
|
||||
$result = $transformer->transform($bill);
|
||||
|
||||
$this->assertEquals($bill->name, $result['name']);
|
||||
$this->assertEquals($noteText, $result['notes']);
|
||||
$this->assertTrue($result['active']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Coverage for dates.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user