From f4e7d7a2cc008f58ba49c5c873db19ef9e727442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ny=C3=A1rai=20Gerg=C5=91?= Date: Fri, 26 Oct 2018 13:11:12 +0200 Subject: [PATCH] Move hasContent method from DocumentElement class to TraversableElement. It is useful to be able to check a DOM element, not just the whole document how it is containing a content or not. --- src/Element/DocumentElement.php | 12 ------------ src/Element/TraversableElement.php | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Element/DocumentElement.php b/src/Element/DocumentElement.php index c2daf6601..676c2b7f6 100644 --- a/src/Element/DocumentElement.php +++ b/src/Element/DocumentElement.php @@ -36,16 +36,4 @@ public function getContent() { return trim($this->getDriver()->getContent()); } - - /** - * Check whether document has specified content. - * - * @param string $content - * - * @return Boolean - */ - public function hasContent($content) - { - return $this->has('named', array('content', $content)); - } } diff --git a/src/Element/TraversableElement.php b/src/Element/TraversableElement.php index a5e05b999..72316128d 100644 --- a/src/Element/TraversableElement.php +++ b/src/Element/TraversableElement.php @@ -294,4 +294,16 @@ public function attachFileToField($locator, $path) $field->attachFile($path); } + + /** + * Check whether element has specified content. + * + * @param string $content + * + * @return Boolean + */ + public function hasContent($content) + { + return $this->has('named', array('content', $content)); + } }