/** * @param string $locator * @param bool $throwException * @return bool */ public function noElement($locator, $throwException = true) { if (Helper::getRequiredSelector($this, $locator)) { //previous or next $result = Helper::countElements($this, $locator); } else { //page number (1, 2, 3, 4, ...) $result = !$this->hasLink($locator); } if ($result === true) { return true; } if ($throwException) { $message = sprintf('The Paging Link "%s" exists, but should not!', $locator); Helper::throwException($message); } return false; }