You are here

class DocumentElement in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink/src/Element/DocumentElement.php \Behat\Mink\Element\DocumentElement

Document element.

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

Hierarchy

Expanded class hierarchy of DocumentElement

2 files declare their use of DocumentElement
DocumentElementTest.php in vendor/behat/mink/tests/Element/DocumentElementTest.php
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 Boolean
   */
  public function hasContent($content) {
    return $this
      ->has('named', array(
      'content',
      $content,
    ));
  }

}

Members

Namesort descending Modifiers Type Description 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::$selectorsHandler private property
Element::$session private property
Element::$xpathManipulator 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'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 an element(-s) to appear 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.