From 714a762fc98caef2edd5887d40241c360204d313 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Wed, 25 Sep 2013 09:44:05 +0100 Subject: [PATCH 01/15] Removed old way of building icu data. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 01b2b54276..b725715a41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,6 @@ before_script: - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini - sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;' - COMPOSER_ROOT_VERSION=dev-master composer --prefer-source --dev install - - php src/Symfony/Component/Locale/Resources/data/build-data.php - - export USE_INTL_ICU_DATA_VERSION=1 script: - ls -d src/Symfony/*/* | parallel --gnu --keep-order 'echo "Running {} tests"; phpunit --exclude-group tty,benchmark {};' || exit 1 From bb59ac2879f0dba45286693b09261f3f6b31e179 Mon Sep 17 00:00:00 2001 From: Robert Kiss Date: Wed, 25 Sep 2013 11:22:53 +0200 Subject: [PATCH 02/15] fixed HTML5 form attribute handling XPath query --- src/Symfony/Component/DomCrawler/Form.php | 2 +- .../DomCrawler/Tests/CrawlerTest.php | 4 +- .../Component/DomCrawler/Tests/FormTest.php | 76 +++++++++++++------ 3 files changed, 55 insertions(+), 27 deletions(-) diff --git a/src/Symfony/Component/DomCrawler/Form.php b/src/Symfony/Component/DomCrawler/Form.php index 754e78a0a2..7f44a5be5e 100644 --- a/src/Symfony/Component/DomCrawler/Form.php +++ b/src/Symfony/Component/DomCrawler/Form.php @@ -395,7 +395,7 @@ class Form extends Link implements \ArrayAccess // corresponding elements are either descendants or have a matching HTML5 form attribute $formId = Crawler::xpathLiteral($this->node->getAttribute('id')); - $fieldNodes = $xpath->query(sprintf('descendant::input[@form=%s] | descendant::button[@form=%s] | descendant::textarea[@form=%s] | descendant::select[@form=%s] | //form[@id=%s]/input[not(@form)] | //form[@id=%s]/button[not(@form)] | //form[@id=%s]/textarea[not(@form)] | //form[@id=%s]/select[not(@form)]', $formId, $formId, $formId, $formId, $formId, $formId, $formId, $formId), $root); + $fieldNodes = $xpath->query(sprintf('descendant::input[@form=%s] | descendant::button[@form=%s] | descendant::textarea[@form=%s] | descendant::select[@form=%s] | //form[@id=%s]//input[not(@form)] | //form[@id=%s]//button[not(@form)] | //form[@id=%s]//textarea[not(@form)] | //form[@id=%s]//select[not(@form)]', $formId, $formId, $formId, $formId, $formId, $formId, $formId, $formId), $root); foreach ($fieldNodes as $node) { $this->addField($node); } diff --git a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php index c771c7e6c6..394f1c04e0 100644 --- a/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php @@ -466,8 +466,8 @@ EOF $this->assertEquals($crawler->form()->getFormNode()->getAttribute('id'), $crawler2->form()->getFormNode()->getAttribute('id'), '->form() works on elements with form attribute'); $this->assertEquals(array('FooName' => 'FooBar', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form(array('FooName' => 'FooBar'))->getValues(), '->form() takes an array of values to submit as its first argument'); - $this->assertEquals(array('FooName' => 'FooValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form()->getValues(), '->form() takes an array of values to submit as its first argument'); - $this->assertEquals(array('FooBarName' => 'FooBarValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler2->form()->getValues(), '->form() takes an array of values to submit as its first argument'); + $this->assertEquals(array('FooName' => 'FooValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler->form()->getValues(), '->getValues() returns correct form values'); + $this->assertEquals(array('FooBarName' => 'FooBarValue', 'TextName' => 'TextValue', 'FooTextName' => 'FooTextValue'), $crawler2->form()->getValues(), '->getValues() returns correct form values'); try { $this->createTestCrawler()->filterXPath('//ol')->form(); diff --git a/src/Symfony/Component/DomCrawler/Tests/FormTest.php b/src/Symfony/Component/DomCrawler/Tests/FormTest.php index 640201dd27..587717841c 100644 --- a/src/Symfony/Component/DomCrawler/Tests/FormTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/FormTest.php @@ -87,27 +87,7 @@ class FormTest extends \PHPUnit_Framework_TestCase public function testConstructorHandlesFormAttribute() { - $dom = new \DOMDocument(); - $dom->loadHTML(' - -
- - - - - -
- -
- - - - - -
- + + +
+
+
+ + + +
+ +
+ +
+
+
+ + +
+
+