Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DocumentElement.php

class DocumentElement

Document element.

@author Konstantin Kudryashov <ever.zet@gmail.com>

Hierarchy

  • class \Behat\Mink\Element\Element implements \Behat\Mink\Element\ElementInterface
    • class \Behat\Mink\Element\TraversableElement extends \Behat\Mink\Element\Element
      • class \Behat\Mink\Element\DocumentElement extends \Behat\Mink\Element\TraversableElement

Expanded class hierarchy of DocumentElement

1 file declares its use of DocumentElement
Session.php in vendor/behat/mink/src/Session.php

File

vendor/behat/mink/src/Element/DocumentElement.php, line 18

Namespace

Behat\Mink\Element
View source
class DocumentElement extends TraversableElement {
    
    /**
     * Returns XPath for handled element.
     *
     * @return string
     */
    public function getXpath() {
        return '//html';
    }
    
    /**
     * Returns document content.
     *
     * @return string
     */
    public function getContent() {
        return trim($this->getDriver()
            ->getContent());
    }
    
    /**
     * Check whether document has specified content.
     *
     * @param string $content
     *
     * @return bool
     */
    public function hasContent(string $content) {
        return $this->has('named', array(
            'content',
            $content,
        ));
    }

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overriden Title Overrides
DocumentElement::getContent public function Returns document content.
DocumentElement::getXpath public function Returns XPath for handled element. Overrides ElementInterface::getXpath
DocumentElement::hasContent public function Check whether document has specified content.
Element::$driver private property Driver.
Element::$elementFinder private property
Element::$session private property
Element::elementNotFound Deprecated protected function Builds an ElementNotFoundException.
Element::find public function Finds first element with specified selector inside the current element. Overrides ElementInterface::find
Element::findAll public function Finds all elements with specified selector inside the current element. Overrides ElementInterface::findAll
Element::getDriver protected function Returns element&#039;s driver.
Element::getHtml public function Returns element inner html. Overrides ElementInterface::getHtml
Element::getOuterHtml public function Returns element outer html.
Element::getSelectorsHandler Deprecated protected function Returns selectors handler.
Element::getSession Deprecated public function Returns element session. Overrides ElementInterface::getSession
Element::getText public function Returns element text (inside tag). Overrides ElementInterface::getText
Element::has public function Checks whether element with specified selector exists inside the current element. Overrides ElementInterface::has
Element::isValid public function Checks if an element still exists in the DOM. Overrides ElementInterface::isValid
Element::waitFor public function Waits for a value to be available and returns it. Overrides ElementInterface::waitFor
Element::__construct public function Initialize element. 1
TraversableElement::attachFileToField public function Attach file to file field with specified locator.
TraversableElement::checkField public function Checks checkbox with specified locator.
TraversableElement::clickLink public function Clicks link with specified locator.
TraversableElement::fillField public function Fills in field (input, textarea, select) with specified locator.
TraversableElement::findButton public function Finds button (input[type=submit|image|button|reset], button) with specified locator.
TraversableElement::findById public function Finds element by its id.
TraversableElement::findField public function Finds field (input, textarea, select) with specified locator.
TraversableElement::findLink public function Finds link with specified locator.
TraversableElement::hasButton public function Checks whether element has a button (input[type=submit|image|button|reset], button) with specified locator.
TraversableElement::hasCheckedField public function Checks whether element has a checkbox with specified locator, which is checked.
TraversableElement::hasField public function Checks whether element has a field (input, textarea, select) with specified locator.
TraversableElement::hasLink public function Checks whether element has a link with specified locator.
TraversableElement::hasSelect public function Checks whether element has a select field with specified locator.
TraversableElement::hasTable public function Checks whether element has a table with specified locator.
TraversableElement::hasUncheckedField public function Checks whether element has a checkbox with specified locator, which is unchecked.
TraversableElement::pressButton public function Presses button (input[type=submit|image|button|reset], button) with specified locator.
TraversableElement::selectFieldOption public function Selects option from select field with specified locator.
TraversableElement::uncheckField public function Unchecks checkbox with specified locator.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal