Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagof authored and github-actions[bot] committed Sep 27, 2024
1 parent f19fcdf commit afd561b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions database/factories/WorkflowTransitionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public function definition(): array
{
return [

Check failure on line 17 in database/factories/WorkflowTransitionFactory.php

View workflow job for this annotation

GitHub Actions / phpstan

Method Squarebit\Workflows\Database\Factories\WorkflowTransitionFactory::definition() should return array<model property of Squarebit\Workflows\Models\WorkflowTransition, mixed> but returns array<string, (Closure)|int<1, 999>>.
/** @phpstan-ignore-next-line */
'workflow_id' => fn() => WorkflowFactory::new()->create()->id,
'workflow_id' => fn () => WorkflowFactory::new()->create()->id,
/** @phpstan-ignore-next-line */
'from_id' => fn() => WorkflowStatusFactory::new()->create()->id,
'from_id' => fn () => WorkflowStatusFactory::new()->create()->id,
/** @phpstan-ignore-next-line */
'to_id' => fn() => WorkflowStatusFactory::new()->create()->id,
'to_id' => fn () => WorkflowStatusFactory::new()->create()->id,
'order' => random_int(1, 999),
];
}
Expand Down
7 changes: 3 additions & 4 deletions tests/Feature/WorkflowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
WorkflowTransitionFactory::new()->workflow($workflow->id)->from($mid1->to_id)->exit()->create();
WorkflowTransitionFactory::new()->workflow($workflow->id)->from($mid2->to_id)->exit()->create();


$this->secondaryWorkflow = $workflow = WorkflowFactory::new()->create();
WorkflowTransitionFactory::new()->workflow($this->secondaryWorkflow->id)->entry()->create();
});
Expand Down Expand Up @@ -97,18 +96,18 @@
});

test('it deletes model statuses when model is deleted', function () {
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();
expect(WorkflowModelStatus::count())->toBe(1);

$model->delete();
expect(WorkflowModelStatus::count())->toBe(0);
});

test('it queries by workflow', function () {
($model = new WorkflowableModel())->setDefaultWorkflowName($this->workflow->name)->save();
($model = new WorkflowableModel)->setDefaultWorkflowName($this->workflow->name)->save();

expect(WorkflowableModel::query()->inWorkflow($this->workflow->name)->count())->toBe(1)
->and(WorkflowableModel::query()->inWorkflow($this->secondaryWorkflow->name)->count())->toBe(0);
->and(WorkflowableModel::query()->inWorkflow($this->secondaryWorkflow->name)->count())->toBe(0);
});

test('it has toString', function () {
Expand Down

0 comments on commit afd561b

Please sign in to comment.