mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Implement tests.
This commit is contained in:
parent
5d6f44cd91
commit
04b8552d27
@ -1362,12 +1362,12 @@ class TransactionControllerTest extends TestCase
|
|||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
$response->assertJson(
|
$response->assertJson(
|
||||||
[
|
[
|
||||||
'data' => [
|
'data' => [[
|
||||||
'attributes' => [
|
'attributes' => [
|
||||||
'description' => $journal->description,
|
'description' => $journal->description,
|
||||||
'type' => 'Deposit',
|
'type' => 'Deposit',
|
||||||
],
|
],
|
||||||
],
|
]],
|
||||||
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
@ -1423,12 +1423,14 @@ class TransactionControllerTest extends TestCase
|
|||||||
$response->assertJson(
|
$response->assertJson(
|
||||||
[
|
[
|
||||||
'data' => [
|
'data' => [
|
||||||
'attributes' => [
|
[
|
||||||
'description' => $journal->description,
|
'attributes' => [
|
||||||
],
|
'description' => $journal->description,
|
||||||
'links' => [
|
],
|
||||||
0 => [],
|
'links' => [
|
||||||
'self' => true,
|
0 => [],
|
||||||
|
'self' => true,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
@ -70,13 +70,11 @@ class HasAnyCategoryTest extends TestCase
|
|||||||
$journal->categories()->detach();
|
$journal->categories()->detach();
|
||||||
$this->assertEquals(0, $journal->categories()->count());
|
$this->assertEquals(0, $journal->categories()->count());
|
||||||
|
|
||||||
// append to transaction
|
// append to transaction, not to journal.
|
||||||
foreach ($journal->transactions()->get() as $index => $transaction) {
|
foreach ($journal->transactions()->get() as $index => $transaction) {
|
||||||
$transaction->categories()->detach();
|
$transaction->categories()->sync([$category->id]);
|
||||||
if (0 === $index) {
|
|
||||||
$transaction->categories()->save($category);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
$this->assertEquals(0, $journal->categories()->count());
|
||||||
|
|
||||||
$trigger = HasAnyCategory::makeFromStrings('', false);
|
$trigger = HasAnyCategory::makeFromStrings('', false);
|
||||||
$result = $trigger->triggered($journal);
|
$result = $trigger->triggered($journal);
|
||||||
|
Loading…
Reference in New Issue
Block a user