| Conditions | 7 |
| Paths | 7 |
| Total Lines | 28 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 56 |
| Changes | 4 | ||
| Bugs | 2 | Features | 0 |
| 1 | <?php |
||
| 13 | public function findTests($search = null) |
||
| 14 | { |
||
| 15 | if ($search === null || empty($search)) { |
||
| 16 | return $this->findAll(); |
||
| 17 | } |
||
| 18 | |||
| 19 | if (!is_array($search)) { |
||
| 20 | $search = [$search]; |
||
| 21 | } |
||
| 22 | |||
| 23 | $tests = []; |
||
| 24 | |||
| 25 | foreach ($search as $term) { |
||
| 26 | //Find test by name first |
||
| 27 | $test = $this->findByName($term); |
||
| 28 | if ($test !== null) { |
||
| 29 | $tests[] = $test; |
||
| 30 | continue; |
||
| 31 | } |
||
| 32 | |||
| 33 | $testsInGroup = $this->findByGroupName($term); |
||
| 34 | foreach ($testsInGroup as $test) { |
||
| 35 | $tests[] = $test; |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | return $tests; |
||
| 40 | } |
||
| 41 | |||
| 65 |