Improve test coverage.

This commit is contained in:
James Cole
2019-06-13 06:39:05 +02:00
parent 6fdfa722dd
commit aacd218056
13 changed files with 1204 additions and 591 deletions

View File

@@ -343,4 +343,14 @@ class RuleGroupRepository implements RuleGroupRepositoryInterface
return $ruleGroup;
}
/**
* @param string $title
*
* @return RuleGroup|null
*/
public function findByTitle(string $title): ?RuleGroup
{
return $this->user->ruleGroups()->where('title', $title)->first();
}
}

View File

@@ -37,7 +37,7 @@ interface RuleGroupRepositoryInterface
public function count(): int;
/**
* @param RuleGroup $ruleGroup
* @param RuleGroup $ruleGroup
* @param RuleGroup|null $moveTo
*
* @return bool
@@ -51,6 +51,13 @@ interface RuleGroupRepositoryInterface
*/
public function find(int $ruleGroupId): ?RuleGroup;
/**
* @param string $title
*
* @return RuleGroup|null
*/
public function findByTitle(string $title): ?RuleGroup;
/**
* Get all rule groups.
*
@@ -143,7 +150,7 @@ interface RuleGroupRepositoryInterface
/**
* @param RuleGroup $ruleGroup
* @param array $data
* @param array $data
*
* @return RuleGroup
*/