Improve test coverage.

This commit is contained in:
James Cole
2019-08-29 17:53:25 +02:00
parent 91b6b86202
commit 19feefda2d
86 changed files with 3173 additions and 2626 deletions

View File

@@ -53,13 +53,17 @@ class RuleTransformerTest extends TestCase
$repository = $this->mock(RuleRepositoryInterface::class);
/** @var RuleTrigger $ruleTrigger */
$ruleTrigger = RuleTrigger::first();
$ruleTrigger = RuleTrigger::where('trigger_type', '!=', 'user_action')->first();
/** @var RuleTrigger $ruleTrigger */
$moment = RuleTrigger::where('trigger_type', '=', 'user_action')->first();
/** @var RuleAction $ruleAction */
$ruleAction = RuleAction::first();
// mock stuff
$repository->shouldReceive('setUser')->atLeast()->once();
$repository->shouldReceive('getRuleActions')->atLeast()->once()->andReturn(new Collection([$ruleAction]));
$repository->shouldReceive('getRuleTriggers')->atLeast()->once()->andReturn(new Collection([$ruleTrigger]));
$repository->shouldReceive('getRuleTriggers')->atLeast()->once()->andReturn(new Collection([$moment]), new Collection([$ruleTrigger]));
$transformer = app(RuleTransformer::class);
$transformer->setParameters(new ParameterBag);