We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 68ffeab commit 936e483Copy full SHA for 936e483
tests/Unit/Models/ComponentTest.php
@@ -1,8 +1,10 @@
1
<?php
2
3
use Cachet\Enums\ComponentStatusEnum;
4
+use Cachet\Enums\IncidentStatusEnum;
5
use Cachet\Models\Component;
6
use Cachet\Models\ComponentGroup;
7
+use Cachet\Models\Incident;
8
9
it('has a group', function () {
10
$component = Component::factory()->forGroup([
@@ -15,7 +17,9 @@
15
17
});
16
18
19
it('has incidents', function () {
- $component = Component::factory()->hasIncidents(2)->create();
20
+ $component = Component::factory()->hasAttached(Incident::factory()->count(2), [
21
+ 'status' => IncidentStatusEnum::investigating,
22
+ ])->create();
23
24
expect($component->incidents)->toHaveCount(2);
25
0 commit comments