PK :'CVp p phpunit.xml.distnu W+A
./tests/Behat/Mink/
./src/Behat/Mink/
PK :'CVy y phpdoc.ini.distnu W+A ; Default configuration file for PHPDoctor
; This config file will cause PHPDoctor to generate API documentation of
; itself.
; PHPDoctor settings
; -----------------------------------------------------------------------------
; Names of files to parse. This can be a single filename, or a comma separated
; list of filenames. Wildcards are allowed.
files = "*.php"
; Names of files or directories to ignore. This can be a single filename, or a
; comma separated list of filenames. Wildcards are NOT allowed.
ignore = "CVS, .svn, .git, _compiled"
; The directory to look for files in, if not used the PHPDoctor will look in
; the current directory (the directory it is run from).
source_path = "./src"
; If you do not want PHPDoctor to look in each sub directory for files
; uncomment this line.
;subdirs = off
; Set how loud PHPDoctor is as it runs. Quiet mode suppresses all output other
; than warnings and errors. Verbose mode outputs additional messages during
; execution.
;quiet = on
;verbose = on
; Select the doclet to use for generating output.
doclet = standard
;doclet = debug
; The directory to find the doclet in. Doclets are expected to be in a
; directory named after themselves at the location given.
;doclet_path = ./doclets
; The directory to find taglets in. Taglets allow you to make PHPDoctor handle
; new tags and to alter the behavour of existing tags and their output.
;taglet_path = ./taglets
; If the code you are parsing does not use package tags or not all elements
; have package tags, use this setting to place unbound elements into a
; particular package.
default_package = "Behat\Mink"
; Specifies the name of a HTML file containing text for the overview
; documentation to be placed on the overview page. The path is relative to
; "source_path" unless an absolute path is given.
overview = readme.html
; Package comments will be looked for in a file named package.html in the same
; directory as the first source file parsed in that package or in the directory
; given below. If package comments are placed in the directory given below then
; they should be named ".html".
package_comment_dir = ./
; Parse out global variables and/or global constants?
;globals = off
;constants = off
; Generate documentation for all class members
;private = on
; Generate documentation for public and protected class members
;protected = on
; Generate documentation for only public class members
public = on
; Use the PEAR compatible handling of the docblock first sentence
;pear_compat = on
; Standard doclet settings
; -----------------------------------------------------------------------------
; The directory to place generated documentation in. If the given path is
; relative to it will be relative to "source_path".
d = "api"
; Specifies the title to be placed in the HTML tag.
windowtitle = "Behat\Mink"
; Specifies the title to be placed near the top of the overview summary file.
doctitle = "Behat\Mink: browser emulators abstraction library for PHP"
; Specifies the header text to be placed at the top of each output file. The
; header will be placed to the right of the upper navigation bar.
header = "Behat\Mink"
; Specifies the footer text to be placed at the bottom of each output file. The
; footer will be placed to the right of the lower navigation bar.
footer = "Behat\Mink"
; Specifies the text to be placed at the bottom of each output file. The text
; will be placed at the bottom of the page, below the lower navigation bar.
;bottom = "This document was generated by PHPDoctor: The PHP Documentation Creator"
; Create a class tree?
tree = on
PK :'CVvaI= = LICENSEnu W+A Copyright (c) 2011 Konstantin Kudryashov
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.PK :'CV+yb .travis.ymlnu W+A language: php
php:
- 5.3
- 5.4
branches:
only:
- master
- develop
before_script:
- bin/install_deps
script: phpunit --group unittest
PK :'CVj]땟 behat.ymlnu W+A default:
context:
parameters:
javascript_session: selenium
base_url: http://test.mink.dev/
show_cmd: open %s
PK :'CV(YE E bin/install_seleniumnu W+A #!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR/../vendor
wget http://selenium.googlecode.com/files/selenium-server-standalone-2.15.0.jar -O selenium.jar
jar xf selenium.jar core/scripts/atoms.js
ed -- "core/scripts/atoms.js" <<-PATCH
9423s|a.|XPCNativeWrapper(a).|
w
q
PATCH
jar -uf selenium.jar core
rm -r core
PK :'CVp|y y bin/install_depsnu W+A #!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR/..
wget -nc http://getcomposer.org/composer.phar
php composer.phar install
PK :'CViw w bin/run_all_testsnu W+A #!/bin/sh
bin/kill_sahi
bin/start_sahi
bin/kill_selenium
bin/start_selenium
phpunit
bin/kill_selenium
bin/kill_sahi
PK :'CV<2e e bin/start_seleniumnu W+A #!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR/../vendor
java -jar selenium.jar > /dev/null &
sleep 5
PK :'CVp0H H
bin/kill_sahinu W+A #!/bin/sh
ps -ef|grep sahi|grep -v grep|awk '{print $2}'|xargs kill -9
PK :'CV L L bin/kill_seleniumnu W+A #!/bin/sh
ps -ef|grep selenium|grep -v grep|awk '{print $2}'|xargs kill -9
PK :'CV"U bin/releasenu W+A #!/usr/bin/env php
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
* Release script.
*
* Usage: bin/release 0.2.0 beta
*
* @author Konstantin Kudryashov
*/
require_once __DIR__ . '/../vendor/.composer/autoload.php';
use Behat\Mink\Compiler;
system('rm *.phar *.tgz');
if (!isset($argv[1])) {
throw new RuntimeException('You must provide version.');
}
$version = $argv[1];
if (!isset($argv[2])) {
throw new RuntimeException('You must provide stability status (alpha/beta/stable).');
}
$stability = $argv[2];
$ldr = new Compiler\MapFileCompiler($autoloaderFilename = 'autoload.php', $mapFilename = 'autoload_map.php');
$ldr->compile();
echo "Autoloader compiled\n";
$pear = new Compiler\PearCompiler();
$pear->compile($version, $stability);
echo "PEAR package compiled: mink-$version.tgz\n";
$phar = new Compiler\PharCompiler();
$phar->compile($version);
system("cp mink-$version.phar mink.phar");
echo "PHAR package compiled: mink-$version.phar\n";
unlink($autoloaderFilename);
unlink($mapFilename);
exit(0);
PK :'CV-4 bin/install_sahinu W+A #!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR/../vendor
wget http://downloads.sourceforge.net/project/sahi/sahi-v35/20110719/sahi_20110719.zip -O sahi.zip
unzip sahi.zip
rm sahi.zip
PK :'CV4b b bin/start_sahinu W+A #!/bin/sh
BASEDIR=$(dirname $0)
cd $BASEDIR/../vendor/sahi/bin
sh sahi.sh > /dev/null &
sleep 5
PK :'CVl! !
CHANGES.mdnu W+A 1.3.2 / 2011-12-21
==================
* Fixed webdriver registration in MinkContext
1.3.1 / 2011-12-21
==================
* Fixed Composer package
1.3.0 / 2011-12-21
==================
* Brand new Selenium2Driver (webdriver session)
* Multiselect bugfixes
* ZombieDriver back in the business
* Composer now manages dependencies
* Some MinkContext steps got fixes
* Lots of bug fixes and cleanup
1.2.0 / 2011-11-04
==================
* Brand new SeleniumDriver (thanks @alexandresalome)
* Multiselect support (multiple options selection), including new Behat steps
* Ability to select option by it's text (in addition to value)
* ZombieDriver updates
* Use SuiteHooks to populate parameters (no need to call parent __construct anymore)
* Updated Goutte and all vendors
* Lot of bugfixes and new tests
1.1.1 / 2011-08-12
==================
* Fixed Zombie.js server termination on Linux
* Fixed base_url usage for external URLs
1.1.0 / 2011-08-08
==================
* Added Zombie.js driver (thanks @b00giZm)
* Added pt translation (thanks Daniel Gomes)
* Refactored MinkContext and MinkTestCase
1.0.3 / 2011-08-02
==================
* File uploads for empty fields fixed (GoutteDriver)
* Lazy sessions restart
* `show_tmp_dir` option in MinkContext
* Updated to stable Symfony2 components
* SahiClient connection limit bumped to 60 seconds
* Dutch language support
1.0.2 / 2011-07-22
==================
* ElementHtmlException fixed (thanks @Stof)
1.0.1 / 2011-07-21
==================
* Fixed buggy assertions in MinkContext
1.0.0 / 2011-07-20
==================
* Added missing tests for almost everything
* Hude speedup for SahiDriver
* Support for Behat 2.0 contexts
* Bundled PHPUnit TestCase
* Deep element traversing
* Correct behavior of getText() method
* New getHtml() method
* Basic HTTP auth support
* Soft and hard session resetting
* Cookies management
* Browser history interactions (reload(), back(), forward())
* Weaverryan'd exception messages
* Huge amount of bugfixes and small additions
0.3.2 / 2011-06-20
==================
* Fixed file uploads in Goutte driver
* Fixed setting of long texts into fields
* Added getPlainText() (returns text without tags and whitespaces) method to the element's API
* Start_url is now optional parameter
* Default session (if needed) name now need to be always specified by hands with setDefaultSessionName()
* default_driver => default_session
* Updated Symfony Components
0.3.1 / 2011-05-17
==================
* Small SahiClient update (it generates SID now if no provided)
* setActiveSessionName => setDefaultSessionName method rename
0.3.0 / 2011-05-17
==================
* Rewritten from scratch Mink drivers handler. Now it's sessions handler. And Mink now
sessions-centric tool. See examples in readme. Much cleaner API now.
0.2.4 / 2011-05-12
==================
* Fixed wrong url locator function
* Fixed wrong regex in `should see` step
* Fixed delimiters use in `should see` step
* Added url-match step for checking urls against regex
0.2.3 / 2011-05-01
==================
* Updated SahiClient with new version, which is faster and cleaner with it's exceptions
0.2.2 / 2011-05-01
==================
* Ability to use already started browser as SahiDriver aim
* Added japanese translation for bundled steps (thanks @hidenorigoto)
* 10 seconds limit for browser connection in SahiDriver
0.2.1 / 2011-04-21
==================
* Fixed some bundled step definitions
0.2.0 / 2011-04-21
==================
* Additional step definitions
* Support for extended drivers configuration through behat.yml environment parameters
* Lots of new named selectors
* Bug fixes
* Small improvements
0.1.2 / 2011-04-08
==================
* Fixed Sahi url escaping
0.1.1 / 2011-04-06
==================
* Fixed should/should_not steps
* Added spanish translation
* Fixed forms to use element
* Fixed small UnsupportedByDriverException issue
0.1.0 / 2011-04-04
==================
* Initial release
PK :'CVh
composer.jsonnu W+A {
"name": "behat/mink",
"description": "Web acceptance testing framework for PHP 5.3",
"keywords": ["web", "testing", "browser"],
"homepage": "http://mink.behat.org/",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"require": {
"php": ">=5.3.1",
"symfony/browser-kit": ">=2.0",
"symfony/dom-crawler": ">=2.0",
"symfony/css-selector": ">=2.0",
"symfony/finder": ">=2.0",
"symfony/process": ">=2.0",
"fabpot/goutte": "*",
"behat/sahi-client": ">=1.0.1",
"alexandresalome/php-selenium": "*",
"facebook/php-webdriver": "*"
},
"autoload": {
"psr-0": {
"Behat\\Mink": "src/"
}
},
"repositories": {
"fabpot/goutte": {
"package": {
"name": "fabpot/goutte",
"version": "master-dev",
"dist": {
"url": "https://github.com/fabpot/Goutte/zipball/master",
"type": "zip"
},
"source": {
"url": "git://github.com/fabpot/Goutte.git",
"type": "git",
"reference": "master"
},
"require": {
"symfony/browser-kit": ">=2.0",
"symfony/dom-crawler": ">=2.0",
"symfony/css-selector": ">=2.0",
"symfony/finder": ">=2.0",
"symfony/process": ">=2.0",
"zendframework/zend-registry": ">=2.0beta1,<3.0",
"zendframework/zend-loader": ">=2.0beta1,<3.0",
"zendframework/zend-stdlib": ">=2.0beta1,<3.0",
"zendframework/zend-validator": ">=2.0beta1,<3.0",
"zendframework/zend-http": ">=2.0beta1,<3.0",
"zendframework/zend-uri": ">=2.0beta1,<3.0"
},
"autoload": {
"psr-0": { "Goutte": "src/" }
}
}
},
"alexandresalome/php-selenium": {
"package": {
"name": "alexandresalome/php-selenium",
"version": "master-dev",
"dist": {
"url": "https://github.com/alexandresalome/PHP-Selenium/zipball/master",
"type": "zip"
},
"source": {
"url": "git://github.com/alexandresalome/PHP-Selenium.git",
"type": "git",
"reference": "master"
},
"require": {
"symfony/dom-crawler": ">=2.0"
},
"autoload": {
"psr-0": { "Selenium": "src/" }
}
}
},
"facebook/php-webdriver": {
"package": {
"name": "facebook/php-webdriver",
"version": "master-dev",
"dist": {
"url": "https://github.com/facebook/php-webdriver/zipball/master",
"type": "zip"
},
"source": {
"url": "git://github.com/facebook/php-webdriver.git",
"type": "git",
"reference": "master"
},
"autoload": {
"psr-0": {
"WebDriverBase": ".",
"WebDriver": ".",
"WebDriverContainer": ".",
"WebDriverSession": ".",
"WebDriverElement": ".",
"WebDriverEnvironment": ".",
"WebDriverSimpleItem": "."
}
}
}
},
"zendframework/zend-registry": {
"package": {
"name": "zendframework/zend-registry",
"version": "2.0.0beta1",
"dist": {
"url": "http://packages.zendframework.com/get/Zend_Registry-2.0.0beta1.tgz",
"type": "pear"
},
"autoload": {
"psr-0": { "Zend\\Registry": "php/" }
}
}
},
"zendframework/zend-loader": {
"package": {
"name": "zendframework/zend-loader",
"version": "2.0.0beta1",
"dist": {
"url": "http://packages.zendframework.com/get/Zend_Loader-2.0.0beta1.tgz",
"type": "pear"
},
"autoload": {
"psr-0": { "Zend\\Loader": "php/" }
}
}
},
"zendframework/zend-stdlib": {
"package": {
"name": "zendframework/zend-stdlib",
"version": "2.0.0beta1",
"dist": {
"url": "http://packages.zendframework.com/get/Zend_Stdlib-2.0.0beta1.tgz",
"type": "pear"
},
"autoload": {
"psr-0": { "Zend\\Stdlib": "php/" }
}
}
},
"zendframework/zend-validator": {
"package": {
"name": "zendframework/zend-validator",
"version": "2.0.0beta1",
"dist": {
"url": "http://packages.zendframework.com/get/Zend_Validator-2.0.0beta1.tgz",
"type": "pear"
},
"autoload": {
"psr-0": { "Zend\\Validator": "php/" }
}
}
},
"zendframework/zend-http": {
"package": {
"name": "zendframework/zend-http",
"version": "2.0.0beta1",
"dist": {
"url": "http://packages.zendframework.com/get/Zend_Http-2.0.0beta1.tgz",
"type": "pear"
},
"autoload": {
"psr-0": { "Zend\\Http": "php/" }
}
}
},
"zendframework/zend-uri": {
"package": {
"name": "zendframework/zend-uri",
"version": "2.0.0beta1",
"dist": {
"url": "http://packages.zendframework.com/get/Zend_Uri-2.0.0beta1.tgz",
"type": "pear"
},
"autoload": {
"psr-0": { "Zend\\Uri": "php/" }
}
}
}
}
}
PK :'CVq
! ! % features/bootstrap/FeatureContext.phpnu W+A useContext('mink', new Behat\Mink\Behat\Context\MinkContext($parameters));
}
}
PK :'CVg<} } features/mink_feature_ru.featurenu W+A # language: ru
Функционал: Шаги Mink
Для того, чтобы описывать поведение веб-приложений
Как веб-девелопер
Мне нужна возможность говорить с Mink через Behat
@mink:zombie
Сценарий: Стандартная форма (через Sahi)
Допустим я на странице "basic_form.php"
Когда я ввожу "Konstantin" в поле "first_name"
И ввожу "Kudryashov" в поле "lastn"
И я нажимаю "Save"
Тогда я должен видеть "Anket for Konstantin"
И я должен видеть "Lastname: Kudryashov"
Сценарий: Стандартная форма (через Goutte)
Допустим я на странице "basic_form.php"
Когда я заполняю поле "first_name" значением "Konstantin"
И заполняю поле "lastn" значением "Kudryashov"
И нажимаю "Save"
Тогда я должен видеть "Anket for Konstantin"
И я должен видеть "Lastname: Kudryashov"
PK :'CV1wn features/mink_feature.featurenu W+A Feature: Mink steps
In order to describe web application behavior
As a web developer
I need to be able to talk with Mink through Behat features
@javascript
Scenario: Basic form (through Sahi)
Given I am on "basic_form.php"
When I fill in "first_name" with "Konstantin"
And I fill in "Kudryashov" for "lastn"
And I press "Save"
Then I should see "Anket for Konstantin"
And I should see "Lastname: Kudryashov"
Scenario: Basic form (through Goutte)
Given I am on "basic_form.php"
When I fill in "first_name" with "Konstantin"
And I fill in "lastn" with "Kudryashov"
And I press "Save"
Then I should see "Anket for Konstantin"
And I should see "Lastname: Kudryashov"
PK :'CVXݡ / tests/Behat/Mink/Selector/NamedSelectorTest.phpnu W+A registerNamedXpath('some', 'my_xpath');
$this->assertEquals('my_xpath', $selector->translateToXPath('some'));
$this->setExpectedException('InvalidArgumentException');
$selector->translateToXPath('custom');
}
}
PK :'CVN{?! ! - tests/Behat/Mink/Selector/CssSelectorTest.phpnu W+A markTestSkipped('Symfony2 CssSelector component not installed');
}
$selector = new CssSelector();
$this->assertEquals('descendant-or-self::h3', $selector->translateToXPath('h3'));
$this->assertEquals('descendant-or-self::h3/span', $selector->translateToXPath('h3 > span'));
$this->assertEquals("descendant-or-self::h3/*/descendant::*[contains(concat(' ', normalize-space(@class), ' '), ' my_div ')]", $selector->translateToXPath('h3 > .my_div'));
}
}
PK :'CVgFɏ 2 tests/Behat/Mink/Selector/SelectorsHandlerTest.phpnu W+A getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock();
$handler = new SelectorsHandler();
$this->assertFalse($handler->isSelectorRegistered('custom'));
$handler->registerSelector('custom', $selector);
$this->assertTrue($handler->isSelectorRegistered('custom'));
$this->assertSame($selector, $handler->getSelector('custom'));
}
public function testSelectorToXpath()
{
$selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock();
$handler = new SelectorsHandler();
$handler->registerSelector('custom_selector', $selector);
$selector
->expects($this->once())
->method('translateToXPath')
->with($locator = 'some[locator]')
->will($this->returnValue($ret = '[]some[]locator'));
$this->assertEquals($ret, $handler->selectorToXpath('custom_selector', $locator));
$this->setExpectedException('InvalidArgumentException');
$handler->selectorToXpath('undefined', 'asd');
}
public function testXpathLiteral()
{
$handler = new SelectorsHandler();
$this->assertEquals("'some simple string'", $handler->xpathLiteral('some simple string'));
$this->assertEquals(
"'some \"d-brackets\" string'", $handler->xpathLiteral('some "d-brackets" string')
);
$this->assertEquals(
"\"some 's-brackets' string\"", $handler->xpathLiteral('some \'s-brackets\' string')
);
$this->assertEquals(
'concat(\'some \',"\'",\'s-brackets\',"\'",\' and "d-brackets" string\')',
$handler->xpathLiteral('some \'s-brackets\' and "d-brackets" string')
);
}
}
PK :'CVD^T T 0 tests/Behat/Mink/Element/DocumentElementTest.phpnu W+A session = $this->getSessionWithMockedDriver();
$this->document = new DocumentElement($this->session);
}
public function testGetSession()
{
$this->assertEquals($this->session, $this->document->getSession());
}
public function testFindAll()
{
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->with('//html/h3[a]')
->will($this->onConsecutiveCalls(array(2, 3, 4), array(1, 2), array()));
$this->assertEquals(3, count($this->document->findAll('xpath', $xpath = 'h3[a]')));
$selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock();
$selector
->expects($this->once())
->method('translateToXPath')
->with($css = 'h3 > a')
->will($this->returnValue($xpath));
$this->session->getSelectorsHandler()->registerSelector('css', $selector);
$this->assertEquals(2, count($this->document->findAll('css', $css)));
}
public function testFind()
{
$this->session->getDriver()
->expects($this->exactly(3))
->method('find')
->with('//html/h3[a]')
->will($this->onConsecutiveCalls(array(2, 3, 4), array(1, 2), array()));
$this->assertEquals(2, $this->document->find('xpath', $xpath = 'h3[a]'));
$selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock();
$selector
->expects($this->once())
->method('translateToXPath')
->with($css = 'h3 > a')
->will($this->returnValue($xpath));
$this->session->getSelectorsHandler()->registerSelector('css', $selector);
$this->assertEquals(1, $this->document->find('css', $css));
$this->assertNull($this->document->find('xpath', $xpath));
}
public function testFindField()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('field1', 'field2', 'field3'), array()));
$this->assertEquals('field1', $this->document->findField('some field'));
$this->assertEquals(null, $this->document->findField('some field'));
}
public function testFindLink()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('link1', 'link2', 'link3'), array()));
$this->assertEquals('link1', $this->document->findLink('some link'));
$this->assertEquals(null, $this->document->findLink('some link'));
}
public function testFindButton()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('button1', 'button2', 'button3'), array()));
$this->assertEquals('button1', $this->document->findButton('some button'));
$this->assertEquals(null, $this->document->findButton('some button'));
}
public function testFindById()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('id2', 'id3'), array()));
$this->assertEquals('id2', $this->document->findById('some-item-2'));
$this->assertEquals(null, $this->document->findById('some-item-2'));
}
public function testHasSelector()
{
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->with('//html/some xpath')
->will($this->onConsecutiveCalls(array('id2', 'id3'), array()));
$this->assertTrue($this->document->has('xpath', 'some xpath'));
$this->assertFalse($this->document->has('xpath', 'some xpath'));
}
public function testHasContent()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('item1', 'item2'), array()));
$this->assertTrue($this->document->hasContent('some content'));
$this->assertFalse($this->document->hasContent('some content'));
}
public function testHasLink()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('link1', 'link2', 'link3'), array()));
$this->assertTrue($this->document->hasLink('some link'));
$this->assertFalse($this->document->hasLink('some link'));
}
public function testHasButton()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('button1', 'button2', 'button3'), array()));
$this->assertTrue($this->document->hasButton('some button'));
$this->assertFalse($this->document->hasButton('some button'));
}
public function testHasField()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('field1', 'field2', 'field3'), array()));
$this->assertTrue($this->document->hasField('some field'));
$this->assertFalse($this->document->hasField('some field'));
}
public function testHasCheckedField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$checkbox
->expects($this->exactly(2))
->method('isChecked')
->will($this->onConsecutiveCalls(true, false));
$this->session->getDriver()
->expects($this->exactly(3))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array($checkbox), array(), array($checkbox)));
$this->assertTrue($this->document->hasCheckedField('some checkbox'));
$this->assertFalse($this->document->hasCheckedField('some checkbox'));
$this->assertFalse($this->document->hasCheckedField('some checkbox'));
}
public function testHasUncheckedField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$checkbox
->expects($this->exactly(2))
->method('isChecked')
->will($this->onConsecutiveCalls(true, false));
$this->session->getDriver()
->expects($this->exactly(3))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array($checkbox), array(), array($checkbox)));
$this->assertFalse($this->document->hasUncheckedField('some checkbox'));
$this->assertFalse($this->document->hasUncheckedField('some checkbox'));
$this->assertTrue($this->document->hasUncheckedField('some checkbox'));
}
public function testHasSelect()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('select'), array()));
$this->assertTrue($this->document->hasSelect('some select field'));
$this->assertFalse($this->document->hasSelect('some select field'));
}
public function testHasTable()
{
$xpath = <<session->getDriver()
->expects($this->exactly(2))
->method('find')
->with($xpath)
->will($this->onConsecutiveCalls(array('table'), array()));
$this->assertTrue($this->document->hasTable('some table'));
$this->assertFalse($this->document->hasTable('some table'));
}
public function testClickLink()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('click');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->clickLink('some link');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->clickLink('some link');
}
public function testClickButton()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('press');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->pressButton('some button');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->pressButton('some button');
}
public function testFillField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('setValue')
->with('some val');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->fillField('some field', 'some val');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->fillField('some field', 'some val');
}
public function testCheckField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('check');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->checkField('some field');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->checkField('some field');
}
public function testUncheckField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('uncheck');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->uncheckField('some field');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->uncheckField('some field');
}
public function testSelectField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('selectOption')
->with('option2');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->selectFieldOption('some field', 'option2');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->selectFieldOption('some field', 'option2');
}
public function testAttachFileToField()
{
$xpath = <<getMockBuilder('Behat\Mink\Element\NodeElement')
->disableOriginalConstructor()
->getMock();
$node
->expects($this->once())
->method('attachFile')
->with('/path/to/file');
$this->session->getDriver()
->expects($this->exactly(2))
->method('find')
->will($this->onConsecutiveCalls(array($node), array()));
$this->document->attachFileToField('some field', '/path/to/file');
$this->setExpectedException('Behat\Mink\Exception\ElementNotFoundException');
$this->document->attachFileToField('some field', '/path/to/file');
}
public function testGetContent()
{
$this->session->getDriver()
->expects($this->once())
->method('getContent')
->will($this->returnValue($ret = 'page content'));
$this->assertEquals($ret, $this->document->getContent());
}
public function testGetText()
{
$this->session->getDriver()
->expects($this->once())
->method('getText')
->with('//html')
->will($this->returnValue('val1'));
$this->assertEquals('val1', $this->document->getText());
}
}
PK :'CV0%H H , tests/Behat/Mink/Element/NodeElementTest.phpnu W+A session = $this->getSessionWithMockedDriver();
}
public function testGetXpath()
{
$node = new NodeElement('some custom xpath', $this->session);
$this->assertEquals('some custom xpath', $node->getXpath());
$this->assertNotEquals('not some custom xpath', $node->getXpath());
}
public function testGetText()
{
$node = new NodeElement('text_tag', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('getText')
->with('text_tag')
->will($this->returnValue('val1'));
$this->assertEquals('val1', $node->getText());
}
public function testHasAttribute()
{
$node = new NodeElement('input_tag', $this->session);
$this->session->getDriver()
->expects($this->exactly(2))
->method('getAttribute')
->with('input_tag', 'href')
->will($this->onConsecutiveCalls(null, 'http://...'));
$this->assertFalse($node->hasAttribute('href'));
$this->assertTrue($node->hasAttribute('href'));
}
public function testGetAttribute()
{
$node = new NodeElement('input_tag', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('getAttribute')
->with('input_tag', 'href')
->will($this->returnValue('http://...'));
$this->assertEquals('http://...', $node->getAttribute('href'));
}
public function testGetValue()
{
$node = new NodeElement('input_tag', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('getValue')
->with('input_tag')
->will($this->returnValue('val1'));
$this->assertEquals('val1', $node->getValue());
}
public function testSetValue()
{
$node = new NodeElement('input_tag', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('setValue')
->with('input_tag', 'new_val');
$node->setValue('new_val');
}
public function testClick()
{
$node = new NodeElement('link_or_button', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('click')
->with('link_or_button');
$node->click();
}
public function testRightClick()
{
$node = new NodeElement('elem', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('rightClick')
->with('elem');
$node->rightClick();
}
public function testDoubleClick()
{
$node = new NodeElement('elem', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('doubleClick')
->with('elem');
$node->doubleClick();
}
public function testCheck()
{
$node = new NodeElement('checkbox_or_radio', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('check')
->with('checkbox_or_radio');
$node->check();
}
public function testUncheck()
{
$node = new NodeElement('checkbox_or_radio', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('uncheck')
->with('checkbox_or_radio');
$node->uncheck();
}
public function testSelectOption()
{
$node = new NodeElement('select', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('selectOption')
->with('select', 'item1');
$node->selectOption('item1');
}
public function testGetTagName()
{
$node = new NodeElement('html//h3', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('getTagName')
->with('html//h3')
->will($this->returnValue('h3'));
$this->assertEquals('h3', $node->getTagName());
}
public function testIsVisible()
{
$node = new NodeElement('some_xpath', $this->session);
$this->session->getDriver()
->expects($this->exactly(2))
->method('isVisible')
->with('some_xpath')
->will($this->onConsecutiveCalls(true, false));
$this->assertTrue($node->isVisible());
$this->assertFalse($node->isVisible());
}
public function testIsChecked()
{
$node = new NodeElement('some_xpath', $this->session);
$this->session->getDriver()
->expects($this->exactly(2))
->method('isChecked')
->with('some_xpath')
->will($this->onConsecutiveCalls(true, false));
$this->assertTrue($node->isChecked());
$this->assertFalse($node->isChecked());
}
public function testFocus()
{
$node = new NodeElement('some-element', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('focus')
->with('some-element');
$node->focus();
}
public function testBlur()
{
$node = new NodeElement('some-element', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('blur')
->with('some-element');
$node->blur();
}
public function testMouseOver()
{
$node = new NodeElement('some-element', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('mouseOver')
->with('some-element');
$node->mouseOver();
}
public function dragTo()
{
$node = new NodeElement('some_tag1', $this->session);
$this->session->getDriver()
->expects($this->once())
->method('triggerEvent')
->with('some_tag1', 'some_tag3');
$node->dragTo(new NodeElement('some_tag2', $this->session));
}
}
PK :'CV% ( tests/Behat/Mink/Element/ElementTest.phpnu W+A getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock();
$selectors = new SelectorsHandler();
$session = new Session($driver, $selectors);
return $session;
}
}
PK :'CV / tests/Behat/Mink/Driver/Selenium2DriverTest.phpnu W+A getMink()->setDefaultSessionName('webdriver');
}
public function testMouseEvents() {} // Right click and blur are not supported
public function testOtherMouseEvents()
{
$this->getSession()->visit($this->pathTo('/js_test.php'));
$clicker = $this->getSession()->getPage()->find('css', '.elements div#clicker');
$this->assertEquals('not clicked', $clicker->getText());
$clicker->click();
$this->assertEquals('single clicked', $clicker->getText());
$clicker->doubleClick();
$this->assertEquals('double clicked', $clicker->getText());
$clicker->mouseOver();
$this->assertEquals('mouse overed', $clicker->getText());
}
}
PK :'CV% , tests/Behat/Mink/Driver/GoutteDriverTest.phpnu W+A getMink()->setDefaultSessionName('goutte');
}
}
PK :'CV
cR F tests/Behat/Mink/Driver/web-fixtures/js/jquery-ui-1.8.14.custom.min.jsnu W+A /*!
* jQuery UI 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI
*/
(function(c,j){function k(a,b){var d=a.nodeName.toLowerCase();if("area"===d){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&l(a)}return(/input|select|textarea|button|object/.test(d)?!a.disabled:"a"==d?a.href||b:b)&&l(a)}function l(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.14",
keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();
b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this,"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,
"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position");if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",
function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,m,n){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(m)g-=parseFloat(c.curCSS(f,"border"+this+"Width",true))||0;if(n)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,
outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h,d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){return k(a,!isNaN(c.attr(a,"tabindex")))},tabbable:function(a){var b=c.attr(a,"tabindex"),d=isNaN(b);
return(d||b>=0)&&k(a,!d)}});c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=
0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
;/*
* jQuery UI Draggable 1.8.14
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Draggables
*
* Depends:
* jquery.ui.core.js
* jquery.ui.mouse.js
* jquery.ui.widget.js
*/
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options;this.helper=
this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true},
_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=
false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||
!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&
a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!=
"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),
10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+
this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&
!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>=
i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f