| Conditions | 4 |
| Paths | 3 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function locator2Xpath($locator) |
||
| 26 | { |
||
| 27 | if ('.' === $locator || '..' === $locator) { |
||
| 28 | // self or parent xpath |
||
| 29 | return $locator; |
||
| 30 | } |
||
| 31 | |||
| 32 | if (0 === strpos($locator, '//')) { |
||
| 33 | // return early for absolute |
||
| 34 | return DomQuery::cssToXpath(substr($locator, 2)); |
||
| 35 | } |
||
| 36 | |||
| 37 | // dot makes it relative |
||
| 38 | return '.' . DomQuery::cssToXpath($locator); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |