Version 1
[yaffs-website] / vendor / behat / mink / src / Element / DocumentElement.php
1 <?php
2
3 /*
4  * This file is part of the Mink package.
5  * (c) Konstantin Kudryashov <ever.zet@gmail.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 namespace Behat\Mink\Element;
12
13 /**
14  * Document element.
15  *
16  * @author Konstantin Kudryashov <ever.zet@gmail.com>
17  */
18 class DocumentElement extends TraversableElement
19 {
20     /**
21      * Returns XPath for handled element.
22      *
23      * @return string
24      */
25     public function getXpath()
26     {
27         return '//html';
28     }
29
30     /**
31      * Returns document content.
32      *
33      * @return string
34      */
35     public function getContent()
36     {
37         return trim($this->getDriver()->getContent());
38     }
39
40     /**
41      * Check whether document has specified content.
42      *
43      * @param string $content
44      *
45      * @return Boolean
46      */
47     public function hasContent($content)
48     {
49         return $this->has('named', array('content', $content));
50     }
51 }