This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Merge branch 'release/1.0.0'

  • Loading branch information...
2 parents 0760e65 + 99dbfb2 commit e53741df128f80a6caf0661573b1f901fa909033 @everzet everzet committed Jul 20, 2011
Showing with 4,179 additions and 1,642 deletions.
  1. +1 −1 .gitignore
  2. +10 −1 .gitmodules
  3. +17 −0 CHANGES.md
  4. +2 −4 autoload.php → autoload.php.dist
  5. +4 −12 behat.yml
  6. +17 −54 bin/release
  7. +26 −0 features/bootstrap/FeatureContext.php
  8. +2 −2 features/mink_feature.feature
  9. +3 −3 features/mink_feature_ru.feature
  10. +0 −13 features/support/bootstrap.php
  11. +0 −17 features/support/env.php
  12. +0 −63 package.xml.tpl
  13. +705 −0 src/Behat/Mink/Behat/Context/MinkContext.php
  14. +79 −0 src/Behat/Mink/Behat/Context/translations/es.xliff
  15. +32 −32 src/Behat/Mink/{Integration/steps/i18n → Behat/Context/translations}/fr.xliff
  16. +131 −0 src/Behat/Mink/Behat/Context/translations/ja.xliff
  17. +131 −0 src/Behat/Mink/Behat/Context/translations/ru.xliff
  18. +76 −0 src/Behat/Mink/ClassLoader/MapFileClassLoader.php
  19. +56 −28 src/Behat/Mink/ClassLoader/UniversalClassLoader.php
  20. +180 −0 src/Behat/Mink/Compiler/MapFileCompiler.php
  21. +244 −0 src/Behat/Mink/Compiler/PearCompiler.php
  22. +174 −0 src/Behat/Mink/Compiler/PharCompiler.php
  23. +87 −4 src/Behat/Mink/Driver/DriverInterface.php
  24. +162 −34 src/Behat/Mink/Driver/GoutteDriver.php
  25. +151 −33 src/Behat/Mink/Driver/SahiDriver.php
  26. +0 −174 src/Behat/Mink/Element/ActionableElement.php
  27. +4 −154 src/Behat/Mink/Element/DocumentElement.php
  28. +24 −27 src/Behat/Mink/Element/Element.php
  29. +19 −5 src/Behat/Mink/Element/ElementInterface.php
  30. +67 −38 src/Behat/Mink/Element/NodeElement.php
  31. +309 −0 src/Behat/Mink/Element/TraversableElement.php
  32. +7 −0 src/Behat/Mink/Exception/DriverException.php
  33. +56 −0 src/Behat/Mink/Exception/ElementHtmlException.php
  34. +30 −8 src/Behat/Mink/Exception/ElementNotFoundException.php
  35. +34 −0 src/Behat/Mink/Exception/ElementTextException.php
  36. +99 −1 src/Behat/Mink/Exception/Exception.php
  37. +45 −0 src/Behat/Mink/Exception/ExpectationException.php
  38. +33 −0 src/Behat/Mink/Exception/ResponseTextException.php
  39. +4 −4 src/Behat/Mink/Exception/{UnsupportedByDriverException.php → UnsupportedDriverActionException.php}
  40. +0 −107 src/Behat/Mink/Integration/MinkEnvironment.php
  41. +0 −79 src/Behat/Mink/Integration/steps/i18n/es.xliff
  42. +0 −103 src/Behat/Mink/Integration/steps/i18n/ja.xliff
  43. +0 −107 src/Behat/Mink/Integration/steps/i18n/ru.xliff
  44. +0 −175 src/Behat/Mink/Integration/steps/mink_steps.php
  45. +0 −26 src/Behat/Mink/Integration/support/hooks.php
  46. +25 −1 src/Behat/Mink/Mink.php
  47. +135 −0 src/Behat/Mink/PHPUnit/TestCase.php
  48. +3 −3 src/Behat/Mink/Selector/NamedSelector.php
  49. +1 −1 src/Behat/Mink/Selector/SelectorsHandler.php
  50. +78 −0 src/Behat/Mink/Session.php
  51. +0 −191 tests/Behat/Mink/Driver/DriverTest.php
  52. +339 −0 tests/Behat/Mink/Driver/GeneralDriverTest.php
  53. +7 −22 tests/Behat/Mink/Driver/GoutteDriverTest.php
  54. +30 −0 tests/Behat/Mink/Driver/HeadlessDriverTest.php
  55. +97 −0 tests/Behat/Mink/Driver/JavascriptDriverTest.php
  56. +9 −8 tests/Behat/Mink/Driver/SahiDriverTest.php
  57. +1 −1 tests/Behat/Mink/Driver/web-fixtures/advanced_form_post.php
  58. +30 −0 tests/Behat/Mink/Driver/web-fixtures/aria_roles.php
  59. +15 −0 tests/Behat/Mink/Driver/web-fixtures/cookie_page1.php
  60. +12 −0 tests/Behat/Mink/Driver/web-fixtures/cookie_page2.php
  61. +18 −0 tests/Behat/Mink/Driver/web-fixtures/cookie_page3.php
  62. +3 −0 tests/Behat/Mink/Driver/web-fixtures/headers.php
  63. +17 −0 tests/Behat/Mink/Driver/web-fixtures/index.php
  64. +18 −0 tests/Behat/Mink/Driver/web-fixtures/js/jquery-1.6.2-min.js
  65. +127 −0 tests/Behat/Mink/Driver/web-fixtures/js/jquery-ui-1.8.14.custom.min.js
  66. +84 −0 tests/Behat/Mink/Driver/web-fixtures/js_test.php
  67. +7 −0 tests/Behat/Mink/Driver/web-fixtures/json.php
  68. +2 −1 tests/Behat/Mink/Driver/web-fixtures/links.php
  69. +2 −0 tests/Behat/Mink/Driver/web-fixtures/print_cookies.php
  70. +12 −0 tests/Behat/Mink/Driver/web-fixtures/randomizer.php
  71. +3 −1 tests/Behat/Mink/Driver/web-fixtures/redirector.php
  72. +20 −0 tests/Behat/Mink/Driver/web-fixtures/session_test.php
  73. +38 −86 tests/Behat/Mink/Element/DocumentElementTest.php
  74. +12 −12 tests/Behat/Mink/Element/NodeElementTest.php
  75. +1 −1 tests/Behat/Mink/Selector/CssSelectorTest.php
  76. +5 −1 tests/bootstrap.php
  77. +1 −1 vendor/Buzz
  78. +1 −1 vendor/Goutte
  79. +1 −1 vendor/SahiClient
  80. +1 −0 vendor/Symfony/Component/BrowserKit
  81. +1 −1 vendor/Symfony/Component/CssSelector
  82. +1 −0 vendor/Symfony/Component/DomCrawler
  83. +1 −0 vendor/Symfony/Component/Process
View
@@ -1,3 +1,3 @@
*.tgz
+*.phar
phpunit.xml
-*.rb
View
@@ -1,6 +1,6 @@
[submodule "vendor/Goutte"]
path = vendor/Goutte
- url = git://github.com/everzet/Goutte.git
+ url = git://github.com/fabpot/Goutte.git
[submodule "vendor/Symfony/Component/CssSelector"]
path = vendor/Symfony/Component/CssSelector
url = git://github.com/symfony/CssSelector.git
@@ -13,3 +13,12 @@
[submodule "vendor/Symfony/Component/Finder"]
path = vendor/Symfony/Component/Finder
url = git://github.com/symfony/Finder
+[submodule "vendor/Symfony/Component/BrowserKit"]
+ path = vendor/Symfony/Component/BrowserKit
+ url = git://github.com/symfony/BrowserKit.git
+[submodule "vendor/Symfony/Component/Process"]
+ path = vendor/Symfony/Component/Process
+ url = git://github.com/symfony/Process.git
+[submodule "vendor/Symfony/Component/DomCrawler"]
+ path = vendor/Symfony/Component/DomCrawler
+ url = git://github.com/symfony/DomCrawler.git
View
@@ -1,3 +1,20 @@
+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
==================
@@ -8,8 +8,6 @@
* file that was distributed with this source code.
*/
-define('BEHAT_MINK_PATH', __DIR__);
-
if (!class_exists('Behat\Mink\ClassLoader\UniversalClassLoader')) {
require_once __DIR__ . '/src/Behat/Mink/ClassLoader/UniversalClassLoader.php';
}
@@ -21,7 +19,7 @@
'Behat\SahiClient' => __DIR__ . '/vendor/SahiClient/src',
'Symfony\Component' => __DIR__ . '/vendor',
'Buzz' => __DIR__ . '/vendor/Buzz/lib',
+ 'Goutte' => __DIR__ . '/vendor/Goutte/src',
+ 'Zend' => __DIR__ . '/vendor/Goutte/vendor/zend/library',
));
$loader->register();
-
-require_once __DIR__ . '/vendor/Goutte/goutte.phar';
View
@@ -1,13 +1,5 @@
default:
- paths:
- steps:
- - %behat.paths.features%/steps
- - %%BEHAT_MINK_PATH%%/src/Behat/Mink/Integration/steps
- steps_i18n:
- - %behat.paths.features%/steps/i18n
- - %%BEHAT_MINK_PATH%%/src/Behat/Mink/Integration/steps/i18n
- hooks:
- - %behat.paths.support%/hooks.php
- - %%BEHAT_MINK_PATH%%/src/Behat/Mink/Integration/support/hooks.php
- environment:
- class: Behat\Mink\Integration\MinkEnvironment
+ context:
+ parameters:
+ base_url: http://test.mink.dev/
+ show_cmd: open %s
View
@@ -17,70 +17,33 @@
* @author Konstantin Kudryashov <ever.zet@gmail.com>
*/
-require_once __DIR__ . '/../autoload.php';
+require_once __DIR__ . '/../autoload.php.dist';
+
+use Behat\Mink\Compiler;
if (!isset($argv[1])) {
- throw new Exception('You must provide version.');
+ throw new RuntimeException('You must provide version.');
}
+$version = $argv[1];
if (!isset($argv[2])) {
- throw new Exception('You must provide stability status (alpha/beta/stable).');
+ throw new RuntimeException('You must provide stability status (alpha/beta/stable).');
}
-
-$version = $argv[1];
$stability = $argv[2];
-print sprintf("Releasing mink version \"%s\".\n", $version);
-
-if (is_file('package.xml')) {
- unlink(getcwd().'/package.xml');
-}
-
-copy(getcwd().'/package.xml.tpl', getcwd().'/package.xml');
-
-$dirs = array(
- 'features',
- 'src',
- 'vendor/Symfony/Component/CssSelector',
- 'vendor/SahiClient',
- 'vendor/Buzz'
-);
-
-$xmlSourceFiles = '';
-foreach ($dirs as $dir) {
- $finder = new Symfony\Component\Finder\Finder();
- $sourceFiles = $finder->files()->in($dir);
-
- foreach ($sourceFiles as $file) {
- $xmlSourceFiles .= '<file role="php" baseinstalldir="mink" install-as="'.$file->getPathName().'" name="'.$file->getPathName().'" />'."\n";
- }
-}
-
-function replaceTokens($files, $beginToken, $endToken, $tokens)
-{
- if (!is_array($files)) {
- $files = array($files);
- }
-
- foreach ($files as $file) {
- $content = file_get_contents($file);
- foreach ($tokens as $key => $value) {
- $content = str_replace($beginToken.$key.$endToken, $value, $content, $count);
- }
-
- file_put_contents($file, $content);
- }
-}
+$ldr = new Compiler\MapFileCompiler($autoloaderFilename = 'autoload.php', $mapFilename = 'autoload_map.php');
+$ldr->compile();
+echo "Autoloader compiled\n";
-replaceTokens(getcwd().'/package.xml', '##', '##', array(
- 'MINK_VERSION' => $version
- , 'CURRENT_DATE' => date('Y-m-d')
- , 'SOURCE_FILES' => $xmlSourceFiles
- , 'STABILITY' => $stability
-));
+$pear = new Compiler\PearCompiler();
+$pear->compile($version, $stability);
+echo "PEAR package compiled: mink-$version.tgz\n";
-system('pear package');
+$phar = new Compiler\PharCompiler();
+$phar->compile($version);
+echo "PHAR package compiled: mink-$version.phar\n";
-unlink(getcwd().'/package.xml');
+unlink($autoloaderFilename);
+unlink($mapFilename);
exit(0);
@@ -0,0 +1,26 @@
+<?php
+
+use Behat\Behat\Context\ClosuredContextInterface,
+ Behat\Behat\Context\TranslatedContextInterface,
+ Behat\Behat\Context\BehatContext,
+ Behat\Behat\Exception\Pending;
+
+use Behat\Gherkin\Node\PyStringNode,
+ Behat\Gherkin\Node\TableNode;
+
+if (file_exists(__DIR__ . '/../../autoload.php')) {
+ require_once __DIR__ . '/../../autoload.php';
+} else {
+ require_once __DIR__ . '/../../autoload.php.dist';
+}
+
+/**
+ * Features context.
+ */
+class FeatureContext extends BehatContext
+{
+ public function __construct(array $parameters)
+ {
+ $this->useContext(new Behat\Mink\Behat\Context\MinkContext($parameters));
+ }
+}
@@ -5,15 +5,15 @@ Feature: Mink steps
@javascript
Scenario: Basic form (through Sahi)
- Given I am on basic_form.php
+ 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
+ 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"
@@ -6,16 +6,16 @@
@javascript
Сценарий: Стандартная форма (через Sahi)
- Допустим я на странице basic_form.php
+ Допустим я на странице "basic_form.php"
Когда я ввожу "Konstantin" в поле "first_name"
И ввожу "Kudryashov" в поле "lastn"
И я нажимаю "Save"
Тогда я должен видеть "Anket for Konstantin"
И я должен видеть "Lastname: Kudryashov"
Сценарий: Стандартная форма (через Goutte)
- Допустим я на странице basic_form.php
- Когда я заполняю поле "first_name" значением "Konstantin"
+ Допустим я на странице "basic_form.php"
+ Когда я заполняю поле "first_name" значением "Konstantin"
И заполняю поле "lastn" значением "Kudryashov"
И нажимаю "Save"
Тогда я должен видеть "Anket for Konstantin"
@@ -1,13 +0,0 @@
-<?php
-
-/*
- * This file is part of the Behat\Mink.
- * (c) Konstantin Kudryashov <ever.zet@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-require_once __DIR__ . '/../../autoload.php';
-require_once 'PHPUnit/Autoload.php';
-require_once 'PHPUnit/Framework/Assert/Functions.php';
View
@@ -1,17 +0,0 @@
-<?php
-
-/*
- * This file is part of the Behat\Mink.
- * (c) Konstantin Kudryashov <ever.zet@gmail.com>
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-// overwrite start_url parameter (this is a hack for Mink internal testing - use behat env params instead)
-$world->setParameter('start_url', 'http://test.mink.loc/');
-
-// redefine getPathTo method
-$world->getPathTo = function($path) use($world) {
- return $world->getParameter('start_url') . $path;
-};
View
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package packagerversion="1.8.0" version="2.0" xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
- http://pear.php.net/dtd/tasks-1.0.xsd
- http://pear.php.net/dtd/package-2.0
- http://pear.php.net/dtd/package-2.0.xsd">
- <name>mink</name>
- <channel>pear.behat.org</channel>
- <summary>Behat\Mink is an browser emulation framework for PHP</summary>
- <description>
- Behat\Mink is an open source browser emulation framework for php 5.3.
- </description>
- <lead>
- <name>Konstantin Kudryashov</name>
- <user>everzet</user>
- <email>ever.zet@gmail.com</email>
- <active>yes</active>
- </lead>
- <date>##CURRENT_DATE##</date>
- <version>
- <release>##MINK_VERSION##</release>
- <api>1.0.0</api>
- </version>
- <stability>
- <release>##STABILITY##</release>
- <api>##STABILITY##</api>
- </stability>
- <license uri="http://www.opensource.org/licenses/mit-license.php">MIT</license>
- <notes>-</notes>
- <contents>
- <dir name="/">
-
- ##SOURCE_FILES##
-
- <file role="php" baseinstalldir="mink" name="autoload.php" />
- <file role="php" baseinstalldir="mink" name="behat.yml" />
- <file role="php" baseinstalldir="mink" name="CHANGES.md" />
- <file role="php" baseinstalldir="mink" name="LICENSE" />
- <file role="php" baseinstalldir="mink" name="README.md" />
- <file role="php" baseinstalldir="mink" install-as="vendor/Goutte/goutte.phar" name="vendor/Goutte/goutte.phar" />
-
- </dir>
- </contents>
- <dependencies>
- <required>
- <php>
- <min>5.3.1</min>
- </php>
- <pearinstaller>
- <min>1.4.0</min>
- </pearinstaller>
- <extension>
- <name>pcre</name>
- </extension>
- <extension>
- <name>simplexml</name>
- </extension>
- <extension>
- <name>xml</name>
- </extension>
- </required>
- </dependencies>
- <phprelease />
-</package>
Oops, something went wrong.

0 comments on commit e53741d

Please sign in to comment.