X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Finstaclick%2Fphp-webdriver%2Flib%2FWebDriver%2FWindow.php;fp=vendor%2Finstaclick%2Fphp-webdriver%2Flib%2FWebDriver%2FWindow.php;h=2aad99c1b536ae8007062cad10530e16cf91e98d;hp=0000000000000000000000000000000000000000;hb=1270d9129ce8f27c9b28b10518e32132c58e0aca;hpb=c27c0f0cdaa3f354b1fe54a56ae7e854be6e3f68 diff --git a/vendor/instaclick/php-webdriver/lib/WebDriver/Window.php b/vendor/instaclick/php-webdriver/lib/WebDriver/Window.php new file mode 100644 index 000000000..2aad99c1b --- /dev/null +++ b/vendor/instaclick/php-webdriver/lib/WebDriver/Window.php @@ -0,0 +1,89 @@ + + * @author Fabrizio Branca + */ + +namespace WebDriver; + +/** + * WebDriver\Window class + * + * @package WebDriver + * + * @method array getSize() Get size of the window. + * @method void postSize($json) Change the size of the window. + * @method array getPosition() Get position of the window. + * @method void postPosition($json) Change position of the window. + * @method void maximize() Maximize the window if not already maximized. + */ +final class Window extends AbstractWebDriver +{ + /** + * Window handle + * + * @var string + */ + private $windowHandle; + + /** + * {@inheritdoc} + */ + protected function methods() + { + return array( + 'size' => array('GET', 'POST'), + 'position' => array('GET', 'POST'), + 'maximize' => array('POST'), + ); + } + + /** + * {@inheritdoc} + */ + protected function obsoleteMethods() + { + return array( + 'restore' => array('POST'), + ); + } + + /** + * Get window handle + * + * @return string + */ + public function getHandle() + { + return $this->windowHandle; + } + + /** + * Constructor + * + * @param string $url URL + * @param string $windowHandle Window handle + */ + public function __construct($url, $windowHandle) + { + $this->windowHandle = $windowHandle; + + parent::__construct($url . '/' . $windowHandle); + } +}