| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 12 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | View Code Duplication | protected function countElements($element, $index, $parent) |
|
| 12 | { |
||
| 13 | $page = $this->getSession()->getPage(); |
||
| 14 | |||
| 15 | $parents = $page->findAll('css', $parent); |
||
| 16 | if (!isset($parents[$index - 1])) { |
||
| 17 | throw new \Exception("The $index element '$parent' was not found anywhere in the page"); |
||
| 18 | } |
||
| 19 | |||
| 20 | $elements = $parents[$index - 1]->findAll('css', $element); |
||
| 21 | return count($elements); |
||
| 22 | } |
||
| 23 | |||
| 37 |