From 0c5e48d9fe4366860ecc37ea51d68434f4e4f93f Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Thu, 5 Feb 2015 12:56:38 -0500 Subject: [PATCH] Updated dependencies --- composer.lock | 50 +-- vendor/autoload.php | 2 +- vendor/behat/mink/.travis.yml | 13 +- vendor/behat/mink/CHANGES.md | 17 + vendor/behat/mink/README.md | 12 +- vendor/behat/mink/composer.json | 6 +- vendor/behat/mink/driver-testsuite/README.md | 11 +- .../driver-testsuite/tests/AbstractConfig.php | 2 +- .../tests/Basic/ContentTest.php | 2 +- .../tests/Basic/TraversingTest.php | 10 + .../tests/Form/GeneralTest.php | 2 +- .../driver-testsuite/tests/Form/RadioTest.php | 2 +- .../driver-testsuite/tests/Js/EventsTest.php | 6 +- .../mink/driver-testsuite/tests/TestCase.php | 2 +- vendor/behat/mink/phpunit.xml.dist | 2 +- .../{Behat/Mink => }/Driver/CoreDriver.php | 0 .../Mink => }/Driver/DriverInterface.php | 20 +- .../Mink => }/Element/DocumentElement.php | 2 +- .../src/{Behat/Mink => }/Element/Element.php | 0 .../Mink => }/Element/ElementInterface.php | 0 .../{Behat/Mink => }/Element/NodeElement.php | 2 +- .../Mink => }/Element/TraversableElement.php | 10 +- .../Mink => }/Exception/DriverException.php | 0 .../Mink => }/Exception/ElementException.php | 0 .../Exception/ElementHtmlException.php | 0 .../Exception/ElementNotFoundException.php | 2 +- .../Exception/ElementTextException.php | 0 .../{Behat/Mink => }/Exception/Exception.php | 0 .../Exception/ExpectationException.php | 6 +- .../Exception/ResponseTextException.php | 0 .../UnsupportedDriverActionException.php | 0 .../behat/mink/src/{Behat/Mink => }/Mink.php | 0 .../{Behat/Mink => }/Selector/CssSelector.php | 0 .../Mink => }/Selector/ExactNamedSelector.php | 0 .../Mink => }/Selector/NamedSelector.php | 0 .../Selector/PartialNamedSelector.php | 0 .../Mink => }/Selector/SelectorInterface.php | 0 .../Mink => }/Selector/SelectorsHandler.php | 0 .../Mink => }/Selector/Xpath/Escaper.php | 0 .../Mink => }/Selector/Xpath/Manipulator.php | 8 +- .../mink/src/{Behat/Mink => }/Session.php | 0 .../mink/src/{Behat/Mink => }/WebAssert.php | 5 +- .../tests/Element/DocumentElementTest.php | 4 +- .../behat/mink/tests/Element/ElementTest.php | 2 +- .../Exception/ExpectationExceptionTest.php | 42 +++ .../mink/tests/Selector/NamedSelectorTest.php | 3 +- .../tests/Selector/SelectorsHandlerTest.php | 12 + vendor/behat/mink/tests/SessionTest.php | 11 +- vendor/behat/mink/tests/WebAssertTest.php | 32 +- vendor/composer/autoload_namespaces.php | 1 - vendor/composer/autoload_psr4.php | 1 + vendor/composer/autoload_real.php | 8 +- vendor/composer/installed.json | 324 +++++++++--------- .../Component/Process/Pipes/UnixPipes.php | 2 +- .../Component/Process/Pipes/WindowsPipes.php | 2 +- .../Symfony/Component/Process/Process.php | 3 +- .../yaml/Symfony/Component/Yaml/Escaper.php | 8 + .../yaml/Symfony/Component/Yaml/Inline.php | 8 +- .../yaml/Symfony/Component/Yaml/Parser.php | 16 +- .../Tests/Fixtures/unindentedCollections.yml | 20 ++ .../Component/Yaml/Tests/InlineTest.php | 16 + .../Component/Yaml/Tests/ParserTest.php | 27 ++ .../vufindhttp/src/VuFindHttp/HttpService.php | 11 +- .../src/VuFindTest/HttpServiceTest.php | 27 +- 64 files changed, 494 insertions(+), 280 deletions(-) rename vendor/behat/mink/src/{Behat/Mink => }/Driver/CoreDriver.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Driver/DriverInterface.php (98%) rename vendor/behat/mink/src/{Behat/Mink => }/Element/DocumentElement.php (98%) rename vendor/behat/mink/src/{Behat/Mink => }/Element/Element.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Element/ElementInterface.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Element/NodeElement.php (99%) rename vendor/behat/mink/src/{Behat/Mink => }/Element/TraversableElement.php (99%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/DriverException.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/ElementException.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/ElementHtmlException.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/ElementNotFoundException.php (95%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/ElementTextException.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/Exception.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/ExpectationException.php (95%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/ResponseTextException.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Exception/UnsupportedDriverActionException.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Mink.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/CssSelector.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/ExactNamedSelector.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/NamedSelector.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/PartialNamedSelector.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/SelectorInterface.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/SelectorsHandler.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/Xpath/Escaper.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/Selector/Xpath/Manipulator.php (89%) rename vendor/behat/mink/src/{Behat/Mink => }/Session.php (100%) rename vendor/behat/mink/src/{Behat/Mink => }/WebAssert.php (99%) diff --git a/composer.lock b/composer.lock index b725c54b631..9af22c26856 100644 --- a/composer.lock +++ b/composer.lock @@ -512,17 +512,17 @@ }, { "name": "symfony/yaml", - "version": "v2.6.3", + "version": "v2.6.4", "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "82462a90848a52c2533aa6b598b107d68076b018" + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", - "reference": "82462a90848a52c2533aa6b598b107d68076b018", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", "shasum": "" }, "require": { @@ -555,7 +555,7 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", - "time": "2015-01-03 15:33:07" + "time": "2015-01-25 04:39:26" }, { "name": "vufind-org/vufindcode", @@ -595,16 +595,16 @@ }, { "name": "vufind-org/vufindhttp", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/vufind-org/vufindhttp.git", - "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e" + "reference": "ddedf7636f7e8d3fff529157dbc9aa8a2d0ea210" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vufind-org/vufindhttp/zipball/2f56535bd3c306747ecf89ecea33c798f16f8c4e", - "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e", + "url": "https://api.github.com/repos/vufind-org/vufindhttp/zipball/ddedf7636f7e8d3fff529157dbc9aa8a2d0ea210", + "reference": "ddedf7636f7e8d3fff529157dbc9aa8a2d0ea210", "shasum": "" }, "require": { @@ -637,7 +637,7 @@ ], "description": "VuFind 2.x HTTP service library", "homepage": "http://vufind.org/", - "time": "2014-10-16 14:38:35" + "time": "2015-02-05 17:26:35" }, { "name": "zendframework/zendframework", @@ -955,16 +955,16 @@ "packages-dev": [ { "name": "behat/mink", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", - "url": "https://github.com/Behat/Mink.git", - "reference": "090900a0049c441f1e072bbd837db4079b2250c5" + "url": "https://github.com/minkphp/Mink.git", + "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Mink/zipball/090900a0049c441f1e072bbd837db4079b2250c5", - "reference": "090900a0049c441f1e072bbd837db4079b2250c5", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/8b68523a339ec991bcd638b39dc8f04f808da88a", + "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a", "shasum": "" }, "require": { @@ -984,8 +984,8 @@ } }, "autoload": { - "psr-0": { - "Behat\\Mink": "src/" + "psr-4": { + "Behat\\Mink\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -999,14 +999,14 @@ "homepage": "http://everzet.com" } ], - "description": "Web acceptance testing framework for PHP 5.3", + "description": "Browser controller/emulator abstraction for PHP", "homepage": "http://mink.behat.org/", "keywords": [ "browser", "testing", "web" ], - "time": "2014-09-26 09:25:05" + "time": "2015-02-04 17:02:06" }, { "name": "behat/mink-zombie-driver", @@ -1068,7 +1068,7 @@ }, { "name": "symfony/css-selector", - "version": "v2.6.3", + "version": "v2.6.4", "target-dir": "Symfony/Component/CssSelector", "source": { "type": "git", @@ -1119,17 +1119,17 @@ }, { "name": "symfony/process", - "version": "v2.6.3", + "version": "v2.6.4", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92" + "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/319794f611bd8bdefbac72beb3f05e847f8ebc92", - "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92", + "url": "https://api.github.com/repos/symfony/Process/zipball/ecfc23e89d9967999fa5f60a1e9af7384396e9ae", + "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae", "shasum": "" }, "require": { @@ -1162,7 +1162,7 @@ ], "description": "Symfony Process Component", "homepage": "http://symfony.com", - "time": "2015-01-06 22:47:52" + "time": "2015-01-25 04:39:26" } ], "aliases": [], diff --git a/vendor/autoload.php b/vendor/autoload.php index 5b0c21812b8..1dcb625cf88 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit33a49fb77f37eff1109c166f3c8fbb99::getLoader(); +return ComposerAutoloaderInit66b0b660d01ce78c00a4156c126432d3::getLoader(); diff --git a/vendor/behat/mink/.travis.yml b/vendor/behat/mink/.travis.yml index 74ea58cc9c1..4c0c786d404 100644 --- a/vendor/behat/mink/.travis.yml +++ b/vendor/behat/mink/.travis.yml @@ -1,12 +1,17 @@ language: php +sudo: false + php: [5.3, 5.4, 5.5, 5.6, hhvm] -before_script: - - composer install --dev --prefer-source +cache: + directories: + - $HOME/.composer/cache + +install: + - composer install script: phpunit -v --coverage-clover=coverage.clover after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover + - wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover diff --git a/vendor/behat/mink/CHANGES.md b/vendor/behat/mink/CHANGES.md index 3404cad5286..e21d5aff6f4 100644 --- a/vendor/behat/mink/CHANGES.md +++ b/vendor/behat/mink/CHANGES.md @@ -1,3 +1,20 @@ +1.6.1 / 2015-02-04 +================== + +Bug fixes: + +* Added a check for empty path in `WebAssert::cleanUrl()` + +Driver testsuite: + +* Added an extra test to ensure the right behavior for traversal + +Misc: + +* Changed the description in the composer.json +* Switched the repository structure to use PSR-4 +* Updated URLs for the move to the new Github organization + 1.6.0 / 2014-09-26 ================== diff --git a/vendor/behat/mink/README.md b/vendor/behat/mink/README.md index d87cf3a06ac..2299506a607 100644 --- a/vendor/behat/mink/README.md +++ b/vendor/behat/mink/README.md @@ -3,9 +3,9 @@ Mink [](https://packagist.org/packages/behat/mink) [](https://packagist.org/packages/behat/mink) [](https://packagist.org/packages/behat/mink) -[](https://scrutinizer-ci.com/g/Behat/Mink/) -[](https://scrutinizer-ci.com/g/Behat/Mink/) -[](https://travis-ci.org/Behat/Mink) +[](https://scrutinizer-ci.com/g/minkphp/Mink/?branch=master) +[](https://scrutinizer-ci.com/g/minkphp/Mink/) +[](https://travis-ci.org/minkphp/Mink) [](https://insight.sensiolabs.com/projects/5bb8fab0-978f-428a-ae23-44ee4e129fbc) [](https://packagist.org/packages/behat/mink) @@ -68,5 +68,7 @@ $> php composer.phar install Contributors ------------ -* Konstantin Kudryashov [everzet](http://github.com/everzet) [lead developer] -* Other [awesome developers](https://github.com/Behat/Mink/graphs/contributors) +* Konstantin Kudryashov [everzet](https://github.com/everzet) [lead developer] +* Christophe Coevoet [stof](https://github.com/stof) [lead developer] +* Alexander Obuhovich [aik099](https://github.com/aik099) [lead developer] +* Other [awesome developers](https://github.com/minkphp/Mink/graphs/contributors) diff --git a/vendor/behat/mink/composer.json b/vendor/behat/mink/composer.json index 0aeee7bfbe6..7a8723f0722 100644 --- a/vendor/behat/mink/composer.json +++ b/vendor/behat/mink/composer.json @@ -1,6 +1,6 @@ { "name": "behat/mink", - "description": "Web acceptance testing framework for PHP 5.3", + "description": "Browser controller/emulator abstraction for PHP", "keywords": ["web", "testing", "browser"], "homepage": "http://mink.behat.org/", "type": "library", @@ -27,8 +27,8 @@ }, "autoload": { - "psr-0": { - "Behat\\Mink": "src/" + "psr-4": { + "Behat\\Mink\\": "src/" } }, diff --git a/vendor/behat/mink/driver-testsuite/README.md b/vendor/behat/mink/driver-testsuite/README.md index d21a7472a83..f2af9a8f6b6 100644 --- a/vendor/behat/mink/driver-testsuite/README.md +++ b/vendor/behat/mink/driver-testsuite/README.md @@ -16,7 +16,7 @@ The testsuite of a driver should be based as follow: "autoload-dev": { "psr-4": { - "Acme\MyDriver\Tests\\": "tests" + "Acme\\MyDriver\\Tests\\": "tests" } } } @@ -34,15 +34,18 @@ The testsuite of a driver should be based as follow: </php> <testsuites> - <testsuite name="Driver test suite"> - <directory>./tests/</directory><!-- if needed to add more tests --> + <testsuite name="Functional tests"> <directory>vendor/behat/mink/driver-testsuite/tests</directory> </testsuite> + <!-- if needed to add more tests --> + <testsuite name="Driver tests"> + <directory>./tests/</directory> + </testsuite> </testsuites> <filter> <whitelist> - <directory>./src/Acme/MyDriver</directory> + <directory>./src</directory> </whitelist> </filter> </phpunit> diff --git a/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php b/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php index 5d02df2c11e..f654297561f 100644 --- a/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php +++ b/vendor/behat/mink/driver-testsuite/tests/AbstractConfig.php @@ -26,7 +26,7 @@ abstract class AbstractConfig return $file; } - $pattern = '/^' . preg_quote($_SERVER['TEST_MACHINE_BASE_PATH'], '/') . '/'; + $pattern = '/^'.preg_quote($_SERVER['TEST_MACHINE_BASE_PATH'], '/').'/'; $basePath = $_SERVER['DRIVER_MACHINE_BASE_PATH']; return preg_replace($pattern, $basePath, $file, 1); diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php index e68e8d0ebb2..6f516e814ae 100644 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php +++ b/vendor/behat/mink/driver-testsuite/tests/Basic/ContentTest.php @@ -28,7 +28,7 @@ class ContentTest extends TestCase { $this->getSession()->visit($this->pathTo('/index.html')); - $element = $this->getSession()->getPage()->findById('attr-elem[' . $attributeName . ']'); + $element = $this->getSession()->getPage()->findById('attr-elem['.$attributeName.']'); $this->assertNotNull($element); $this->assertSame($attributeValue, $element->getAttribute($attributeName)); diff --git a/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php b/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php index b31f7fc954b..3bcb7ac01a6 100644 --- a/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php +++ b/vendor/behat/mink/driver-testsuite/tests/Basic/TraversingTest.php @@ -126,4 +126,14 @@ class TraversingTest extends TestCase $this->assertFalse($subUrl->has('css', 'em')); $this->assertEquals('deep', $subUrl->find('css', 'strong')->getText()); } + + public function testFindingChild() + { + $this->getSession()->visit($this->pathTo('/index.html')); + + $form = $this->getSession()->getPage()->find('css', 'footer form'); + $this->assertNotNull($form); + + $this->assertCount(1, $form->findAll('css', 'input'), 'Elements are searched only in the element, not in all previous matches'); + } } diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php b/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php index 263be70baef..f15f266e015 100644 --- a/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php +++ b/vendor/behat/mink/driver-testsuite/tests/Form/GeneralTest.php @@ -188,7 +188,7 @@ class GeneralTest extends TestCase $notes->setValue('new notes'); $this->assertEquals('new notes', $notes->getValue()); - $about->attachFile($this->mapRemoteFilePath(__DIR__ . '/../../web-fixtures/some_file.txt')); + $about->attachFile($this->mapRemoteFilePath(__DIR__.'/../../web-fixtures/some_file.txt')); $button = $page->findButton('Register'); $this->assertNotNull($button); diff --git a/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php b/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php index 39cd743a2a0..b21ab7d61f1 100644 --- a/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php +++ b/vendor/behat/mink/driver-testsuite/tests/Form/RadioTest.php @@ -75,7 +75,7 @@ class RadioTest extends TestCase $session->visit($this->pathTo('/advanced_form.html')); $page = $session->getPage(); - $sex = $page->find('xpath', '//*[@name = "sex"]' . "\n|\n" . '//*[@id = "sex"]'); + $sex = $page->find('xpath', '//*[@name = "sex"]'."\n|\n".'//*[@id = "sex"]'); $this->assertNotNull($sex, 'xpath with line ending works'); $sex->setValue('m'); diff --git a/vendor/behat/mink/driver-testsuite/tests/Js/EventsTest.php b/vendor/behat/mink/driver-testsuite/tests/Js/EventsTest.php index 00d084b47e0..e49d83715fa 100644 --- a/vendor/behat/mink/driver-testsuite/tests/Js/EventsTest.php +++ b/vendor/behat/mink/driver-testsuite/tests/Js/EventsTest.php @@ -99,13 +99,13 @@ class EventsTest extends TestCase $event = $webAssert->elementExists('css', '.elements .text-event'); $input1->keyDown('u', $modifier); - $this->assertEquals('key downed:' . $eventProperties, $event->getText()); + $this->assertEquals('key downed:'.$eventProperties, $event->getText()); $input2->keyPress('r', $modifier); - $this->assertEquals('key pressed:114 / ' . $eventProperties, $event->getText()); + $this->assertEquals('key pressed:114 / '.$eventProperties, $event->getText()); $input3->keyUp(78, $modifier); - $this->assertEquals('key upped:78 / ' . $eventProperties, $event->getText()); + $this->assertEquals('key upped:78 / '.$eventProperties, $event->getText()); } public function provideKeyboardEventsModifiers() diff --git a/vendor/behat/mink/driver-testsuite/tests/TestCase.php b/vendor/behat/mink/driver-testsuite/tests/TestCase.php index 22860f66081..ea003ce5c47 100644 --- a/vendor/behat/mink/driver-testsuite/tests/TestCase.php +++ b/vendor/behat/mink/driver-testsuite/tests/TestCase.php @@ -132,7 +132,7 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase */ protected function pathTo($path) { - return rtrim(self::getConfig()->getWebFixturesUrl(), '/') . '/' . ltrim($path, '/'); + return rtrim(self::getConfig()->getWebFixturesUrl(), '/').'/'.ltrim($path, '/'); } /** diff --git a/vendor/behat/mink/phpunit.xml.dist b/vendor/behat/mink/phpunit.xml.dist index bf73a6958fe..6695433a05d 100644 --- a/vendor/behat/mink/phpunit.xml.dist +++ b/vendor/behat/mink/phpunit.xml.dist @@ -9,7 +9,7 @@ <filter> <whitelist> - <directory>./src/Behat/Mink/</directory> + <directory>./src</directory> </whitelist> </filter> </phpunit> diff --git a/vendor/behat/mink/src/Behat/Mink/Driver/CoreDriver.php b/vendor/behat/mink/src/Driver/CoreDriver.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Driver/CoreDriver.php rename to vendor/behat/mink/src/Driver/CoreDriver.php diff --git a/vendor/behat/mink/src/Behat/Mink/Driver/DriverInterface.php b/vendor/behat/mink/src/Driver/DriverInterface.php similarity index 98% rename from vendor/behat/mink/src/Behat/Mink/Driver/DriverInterface.php rename to vendor/behat/mink/src/Driver/DriverInterface.php index 831d408d064..8357caa8b90 100644 --- a/vendor/behat/mink/src/Behat/Mink/Driver/DriverInterface.php +++ b/vendor/behat/mink/src/Driver/DriverInterface.php @@ -623,15 +623,15 @@ interface DriverInterface */ public function maximizeWindow($name = null); - /** - * Submits the form. - * - * @param string $xpath Xpath. - * - * @throws UnsupportedDriverActionException When operation not supported by the driver - * @throws DriverException When the operation cannot be done - * - * @see \Behat\Mink\Element\NodeElement::submitForm - */ + /** + * Submits the form. + * + * @param string $xpath Xpath. + * + * @throws UnsupportedDriverActionException When operation not supported by the driver + * @throws DriverException When the operation cannot be done + * + * @see \Behat\Mink\Element\NodeElement::submitForm + */ public function submitForm($xpath); } diff --git a/vendor/behat/mink/src/Behat/Mink/Element/DocumentElement.php b/vendor/behat/mink/src/Element/DocumentElement.php similarity index 98% rename from vendor/behat/mink/src/Behat/Mink/Element/DocumentElement.php rename to vendor/behat/mink/src/Element/DocumentElement.php index dc6bc6e1b07..edde3c35392 100644 --- a/vendor/behat/mink/src/Behat/Mink/Element/DocumentElement.php +++ b/vendor/behat/mink/src/Element/DocumentElement.php @@ -47,7 +47,7 @@ class DocumentElement extends TraversableElement public function hasContent($content) { return $this->has('named', array( - 'content', $this->getSelectorsHandler()->xpathLiteral($content) + 'content', $this->getSelectorsHandler()->xpathLiteral($content), )); } } diff --git a/vendor/behat/mink/src/Behat/Mink/Element/Element.php b/vendor/behat/mink/src/Element/Element.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Element/Element.php rename to vendor/behat/mink/src/Element/Element.php diff --git a/vendor/behat/mink/src/Behat/Mink/Element/ElementInterface.php b/vendor/behat/mink/src/Element/ElementInterface.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Element/ElementInterface.php rename to vendor/behat/mink/src/Element/ElementInterface.php diff --git a/vendor/behat/mink/src/Behat/Mink/Element/NodeElement.php b/vendor/behat/mink/src/Element/NodeElement.php similarity index 99% rename from vendor/behat/mink/src/Behat/Mink/Element/NodeElement.php rename to vendor/behat/mink/src/Element/NodeElement.php index 1f867ed0d0e..8e43546267a 100644 --- a/vendor/behat/mink/src/Behat/Mink/Element/NodeElement.php +++ b/vendor/behat/mink/src/Element/NodeElement.php @@ -229,7 +229,7 @@ class NodeElement extends TraversableElement } $opt = $this->find('named', array( - 'option', $this->getSelectorsHandler()->xpathLiteral($option) + 'option', $this->getSelectorsHandler()->xpathLiteral($option), )); if (null === $opt) { diff --git a/vendor/behat/mink/src/Behat/Mink/Element/TraversableElement.php b/vendor/behat/mink/src/Element/TraversableElement.php similarity index 99% rename from vendor/behat/mink/src/Behat/Mink/Element/TraversableElement.php rename to vendor/behat/mink/src/Element/TraversableElement.php index 27843d2dd65..0621af3e55d 100644 --- a/vendor/behat/mink/src/Behat/Mink/Element/TraversableElement.php +++ b/vendor/behat/mink/src/Element/TraversableElement.php @@ -55,7 +55,7 @@ abstract class TraversableElement extends Element public function findLink($locator) { return $this->find('named', array( - 'link', $this->getSelectorsHandler()->xpathLiteral($locator) + 'link', $this->getSelectorsHandler()->xpathLiteral($locator), )); } @@ -99,7 +99,7 @@ abstract class TraversableElement extends Element public function findButton($locator) { return $this->find('named', array( - 'button', $this->getSelectorsHandler()->xpathLiteral($locator) + 'button', $this->getSelectorsHandler()->xpathLiteral($locator), )); } @@ -143,7 +143,7 @@ abstract class TraversableElement extends Element public function findField($locator) { return $this->find('named', array( - 'field', $this->getSelectorsHandler()->xpathLiteral($locator) + 'field', $this->getSelectorsHandler()->xpathLiteral($locator), )); } @@ -246,7 +246,7 @@ abstract class TraversableElement extends Element public function hasSelect($locator) { return $this->has('named', array( - 'select', $this->getSelectorsHandler()->xpathLiteral($locator) + 'select', $this->getSelectorsHandler()->xpathLiteral($locator), )); } @@ -282,7 +282,7 @@ abstract class TraversableElement extends Element public function hasTable($locator) { return $this->has('named', array( - 'table', $this->getSelectorsHandler()->xpathLiteral($locator) + 'table', $this->getSelectorsHandler()->xpathLiteral($locator), )); } diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/DriverException.php b/vendor/behat/mink/src/Exception/DriverException.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/DriverException.php rename to vendor/behat/mink/src/Exception/DriverException.php diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/ElementException.php b/vendor/behat/mink/src/Exception/ElementException.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/ElementException.php rename to vendor/behat/mink/src/Exception/ElementException.php diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/ElementHtmlException.php b/vendor/behat/mink/src/Exception/ElementHtmlException.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/ElementHtmlException.php rename to vendor/behat/mink/src/Exception/ElementHtmlException.php diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/ElementNotFoundException.php b/vendor/behat/mink/src/Exception/ElementNotFoundException.php similarity index 95% rename from vendor/behat/mink/src/Behat/Mink/Exception/ElementNotFoundException.php rename to vendor/behat/mink/src/Exception/ElementNotFoundException.php index 2d379a88c2a..95fd5f0b873 100644 --- a/vendor/behat/mink/src/Behat/Mink/Exception/ElementNotFoundException.php +++ b/vendor/behat/mink/src/Exception/ElementNotFoundException.php @@ -43,7 +43,7 @@ class ElementNotFoundException extends ExpectationException } else { $selector = 'with '.$selector; } - $message .= ' '.$selector.' "' . $locator . '"'; + $message .= ' '.$selector.' "'.$locator.'"'; } $message .= ' not found.'; diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/ElementTextException.php b/vendor/behat/mink/src/Exception/ElementTextException.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/ElementTextException.php rename to vendor/behat/mink/src/Exception/ElementTextException.php diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/Exception.php b/vendor/behat/mink/src/Exception/Exception.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/Exception.php rename to vendor/behat/mink/src/Exception/Exception.php diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/ExpectationException.php b/vendor/behat/mink/src/Exception/ExpectationException.php similarity index 95% rename from vendor/behat/mink/src/Behat/Mink/Exception/ExpectationException.php rename to vendor/behat/mink/src/Exception/ExpectationException.php index da1723cbf13..25034d1e73e 100644 --- a/vendor/behat/mink/src/Behat/Mink/Exception/ExpectationException.php +++ b/vendor/behat/mink/src/Exception/ExpectationException.php @@ -49,7 +49,7 @@ class ExpectationException extends Exception public function __toString() { try { - $pageText = $this->pipeString($this->trimString($this->getContext()) . "\n"); + $pageText = $this->pipeString($this->trimString($this->getContext())."\n"); $string = sprintf("%s\n\n%s%s", $this->getMessage(), $this->getResponseInfo(), $pageText); } catch (\Exception $e) { return $this->getMessage(); @@ -87,7 +87,7 @@ class ExpectationException extends Exception */ protected function pipeString($string) { - return '| ' . strtr($string, array("\n" => "\n| ")); + return '| '.strtr($string, array("\n" => "\n| ")); } /** @@ -117,7 +117,7 @@ class ExpectationException extends Exception $string = trim($string); if ($count < mb_strlen($string)) { - return mb_substr($string, 0, $count - 3) . '...'; + return mb_substr($string, 0, $count - 3).'...'; } return $string; diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/ResponseTextException.php b/vendor/behat/mink/src/Exception/ResponseTextException.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/ResponseTextException.php rename to vendor/behat/mink/src/Exception/ResponseTextException.php diff --git a/vendor/behat/mink/src/Behat/Mink/Exception/UnsupportedDriverActionException.php b/vendor/behat/mink/src/Exception/UnsupportedDriverActionException.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Exception/UnsupportedDriverActionException.php rename to vendor/behat/mink/src/Exception/UnsupportedDriverActionException.php diff --git a/vendor/behat/mink/src/Behat/Mink/Mink.php b/vendor/behat/mink/src/Mink.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Mink.php rename to vendor/behat/mink/src/Mink.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/CssSelector.php b/vendor/behat/mink/src/Selector/CssSelector.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/CssSelector.php rename to vendor/behat/mink/src/Selector/CssSelector.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/ExactNamedSelector.php b/vendor/behat/mink/src/Selector/ExactNamedSelector.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/ExactNamedSelector.php rename to vendor/behat/mink/src/Selector/ExactNamedSelector.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/NamedSelector.php b/vendor/behat/mink/src/Selector/NamedSelector.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/NamedSelector.php rename to vendor/behat/mink/src/Selector/NamedSelector.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/PartialNamedSelector.php b/vendor/behat/mink/src/Selector/PartialNamedSelector.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/PartialNamedSelector.php rename to vendor/behat/mink/src/Selector/PartialNamedSelector.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/SelectorInterface.php b/vendor/behat/mink/src/Selector/SelectorInterface.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/SelectorInterface.php rename to vendor/behat/mink/src/Selector/SelectorInterface.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/SelectorsHandler.php b/vendor/behat/mink/src/Selector/SelectorsHandler.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/SelectorsHandler.php rename to vendor/behat/mink/src/Selector/SelectorsHandler.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/Xpath/Escaper.php b/vendor/behat/mink/src/Selector/Xpath/Escaper.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Selector/Xpath/Escaper.php rename to vendor/behat/mink/src/Selector/Xpath/Escaper.php diff --git a/vendor/behat/mink/src/Behat/Mink/Selector/Xpath/Manipulator.php b/vendor/behat/mink/src/Selector/Xpath/Manipulator.php similarity index 89% rename from vendor/behat/mink/src/Behat/Mink/Selector/Xpath/Manipulator.php rename to vendor/behat/mink/src/Selector/Xpath/Manipulator.php index 617b314535d..116650a5b51 100644 --- a/vendor/behat/mink/src/Behat/Mink/Selector/Xpath/Manipulator.php +++ b/vendor/behat/mink/src/Selector/Xpath/Manipulator.php @@ -40,7 +40,7 @@ class Manipulator // If the xpath prefix contains a union we need to wrap it in parentheses. if (preg_match(self::UNION_PATTERN, $prefix)) { - $prefix = '(' . $prefix . ')'; + $prefix = '('.$prefix.')'; } // Split any unions into individual expressions. @@ -57,11 +57,11 @@ class Manipulator // add prefix before element selector if (0 === strpos($expression, '/')) { - $expression = $prefix . $expression; + $expression = $prefix.$expression; } else { - $expression = $prefix . '/' . $expression; + $expression = $prefix.'/'.$expression; } - $expressions[] = $parenthesis . $expression; + $expressions[] = $parenthesis.$expression; } return implode(' | ', $expressions); diff --git a/vendor/behat/mink/src/Behat/Mink/Session.php b/vendor/behat/mink/src/Session.php similarity index 100% rename from vendor/behat/mink/src/Behat/Mink/Session.php rename to vendor/behat/mink/src/Session.php diff --git a/vendor/behat/mink/src/Behat/Mink/WebAssert.php b/vendor/behat/mink/src/WebAssert.php similarity index 99% rename from vendor/behat/mink/src/Behat/Mink/WebAssert.php rename to vendor/behat/mink/src/WebAssert.php index 8cb3659793f..127c3c14b34 100644 --- a/vendor/behat/mink/src/Behat/Mink/WebAssert.php +++ b/vendor/behat/mink/src/WebAssert.php @@ -647,9 +647,10 @@ class WebAssert protected function cleanUrl($url) { $parts = parse_url($url); - $fragment = empty($parts['fragment']) ? '' : '#' . $parts['fragment']; + $fragment = empty($parts['fragment']) ? '' : '#'.$parts['fragment']; + $path = empty($parts['path']) ? '/' : $parts['path']; - return preg_replace('/^\/[^\.\/]+\.php/', '', $parts['path']) . $fragment; + return preg_replace('/^\/[^\.\/]+\.php/', '', $path).$fragment; } /** diff --git a/vendor/behat/mink/tests/Element/DocumentElementTest.php b/vendor/behat/mink/tests/Element/DocumentElementTest.php index bb42b685f8a..bacd06d8d60 100644 --- a/vendor/behat/mink/tests/Element/DocumentElementTest.php +++ b/vendor/behat/mink/tests/Element/DocumentElementTest.php @@ -33,8 +33,8 @@ class DocumentElementTest extends ElementTest ->expects($this->exactly(2)) ->method('find') ->will($this->returnValueMap(array( - array('//html/' . $xpath, array(2, 3, 4)), - array('//html/' . $css, array(1, 2)), + array('//html/'.$xpath, array(2, 3, 4)), + array('//html/'.$css, array(1, 2)), ))); $this->selectors diff --git a/vendor/behat/mink/tests/Element/ElementTest.php b/vendor/behat/mink/tests/Element/ElementTest.php index 1f9240a13c1..a8c8a8ca90d 100644 --- a/vendor/behat/mink/tests/Element/ElementTest.php +++ b/vendor/behat/mink/tests/Element/ElementTest.php @@ -64,7 +64,7 @@ abstract class ElementTest extends \PHPUnit_Framework_TestCase $this->driver ->expects($this->exactly($times)) ->method('find') - ->with('//html' . $xpath) + ->with('//html'.$xpath) ->will($returnValue); $this->selectors diff --git a/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php b/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php index 23e53bc77da..466bcca63ec 100644 --- a/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php +++ b/vendor/behat/mink/tests/Exception/ExpectationExceptionTest.php @@ -56,6 +56,48 @@ TXT; $this->assertEquals($expected, $exception->__toString()); } + public function testBigContent() + { + $driver = $this->getMock('Behat\Mink\Driver\DriverInterface'); + $page = $this->getPageMock(); + + $session = $this->getSessionMock(); + $session->expects($this->any()) + ->method('getDriver') + ->will($this->returnValue($driver)); + $session->expects($this->any()) + ->method('getPage') + ->will($this->returnValue($page)); + $session->expects($this->any()) + ->method('getStatusCode') + ->will($this->returnValue(200)); + $session->expects($this->any()) + ->method('getCurrentUrl') + ->will($this->returnValue('http://localhost/test')); + + $body = str_repeat('a', 1001 - strlen('<body></body>')); + + $html = sprintf("<html><head><title>Hello</title></head>\n<body>%s</body></html>", $body); + $page->expects($this->any()) + ->method('getContent') + ->will($this->returnValue($html)); + + $expected = <<<'TXT' +Expectation failure + ++--[ HTTP/1.1 200 | http://localhost/test | %s ] +| +| <body>%s</b... +| +TXT; + + $expected = sprintf($expected.' ', get_class($driver), $body); + + $exception = new ExpectationException('Expectation failure', $session); + + $this->assertEquals($expected, $exception->__toString()); + } + public function testExceptionWhileRenderingString() { $session = $this->getSessionMock(); diff --git a/vendor/behat/mink/tests/Selector/NamedSelectorTest.php b/vendor/behat/mink/tests/Selector/NamedSelectorTest.php index 1ce2faa4ea2..e0de1bc226d 100644 --- a/vendor/behat/mink/tests/Selector/NamedSelectorTest.php +++ b/vendor/behat/mink/tests/Selector/NamedSelectorTest.php @@ -38,8 +38,9 @@ abstract class NamedSelectorTest extends \PHPUnit_Framework_TestCase ? $expectedPartialCount : $expectedExactCount; + // Don't use "loadHTMLFile" due HHVM 3.3.0 issue. $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->loadHTMLFile(__DIR__.'/fixtures/'.$fixtureFile); + $dom->loadHTML(file_get_contents(__DIR__.'/fixtures/'.$fixtureFile)); // Escape the locator as Mink 1.x expects the caller of the NamedSelector to handle it $selectorsHandler = new SelectorsHandler(); diff --git a/vendor/behat/mink/tests/Selector/SelectorsHandlerTest.php b/vendor/behat/mink/tests/Selector/SelectorsHandlerTest.php index 8bcb3799782..a20d3d9db7f 100644 --- a/vendor/behat/mink/tests/Selector/SelectorsHandlerTest.php +++ b/vendor/behat/mink/tests/Selector/SelectorsHandlerTest.php @@ -77,4 +77,16 @@ class SelectorsHandlerTest extends \PHPUnit_Framework_TestCase $this->assertEquals("'some simple string'", $handler->xpathLiteral('some simple string')); } + + public function testBcLayer() + { + $selector = $this->getMockBuilder('Behat\Mink\Selector\SelectorInterface')->getMock(); + $handler = new SelectorsHandler(); + + $handler->registerSelector('named_partial', $selector); + + $this->iniSet('error_reporting', -1 & ~E_USER_DEPRECATED); + + $this->assertSame($selector, $handler->getSelector('named')); + } } diff --git a/vendor/behat/mink/tests/SessionTest.php b/vendor/behat/mink/tests/SessionTest.php index b000ba69b5a..9e6796db993 100644 --- a/vendor/behat/mink/tests/SessionTest.php +++ b/vendor/behat/mink/tests/SessionTest.php @@ -21,9 +21,9 @@ class SessionTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); + $this->driver = $this->getMockBuilder('Behat\Mink\Driver\DriverInterface')->getMock(); $this->selectorsHandler = $this->getMockBuilder('Behat\Mink\Selector\SelectorsHandler')->getMock(); - $this->session = new Session($this->driver, $this->selectorsHandler); + $this->session = new Session($this->driver, $this->selectorsHandler); } public function testGetDriver() @@ -41,6 +41,13 @@ class SessionTest extends \PHPUnit_Framework_TestCase $this->assertSame($this->selectorsHandler, $this->session->getSelectorsHandler()); } + public function testInstantiateWithoutOptionalDeps() + { + $session = new Session($this->driver); + + $this->assertInstanceOf('Behat\Mink\Selector\SelectorsHandler', $session->getSelectorsHandler()); + } + public function testIsStarted() { $this->driver->expects($this->once()) diff --git a/vendor/behat/mink/tests/WebAssertTest.php b/vendor/behat/mink/tests/WebAssertTest.php index 9ce5d22fc53..c3bd3cf11c1 100644 --- a/vendor/behat/mink/tests/WebAssertTest.php +++ b/vendor/behat/mink/tests/WebAssertTest.php @@ -2,6 +2,7 @@ namespace Behat\Mink\Tests; +use Behat\Mink\Exception\ExpectationException; use Behat\Mink\WebAssert; class WebAssertTest extends \PHPUnit_Framework_TestCase @@ -20,7 +21,7 @@ class WebAssertTest extends \PHPUnit_Framework_TestCase $this->session = $this->getMockBuilder('Behat\\Mink\\Session') ->disableOriginalConstructor() ->getMock(); - $this->assert = new WebAssert($this->session); + $this->assert = new WebAssert($this->session); } public function testAddressEquals() @@ -40,6 +41,17 @@ class WebAssertTest extends \PHPUnit_Framework_TestCase ); } + public function testAddressEqualsEmptyPath() + { + $this->session + ->expects($this->once()) + ->method('getCurrentUrl') + ->willReturn('http://example.com') + ; + + $this->assertCorrectAssertion('addressEquals', array('/')); + } + public function testAddressNotEquals() { $this->session @@ -74,9 +86,6 @@ class WebAssertTest extends \PHPUnit_Framework_TestCase ); } - /** - * @covers Behat\Mink\WebAssert::cookieEquals - */ public function testCookieEquals() { $this->session-> @@ -98,9 +107,6 @@ class WebAssertTest extends \PHPUnit_Framework_TestCase ); } - /** - * @covers Behat\Mink\WebAssert::cookieExists - */ public function testCookieExists() { $this->session-> @@ -1101,21 +1107,25 @@ class WebAssertTest extends \PHPUnit_Framework_TestCase ); } - protected function assertCorrectAssertion($assertion, $arguments) + private function assertCorrectAssertion($assertion, $arguments) { try { call_user_func_array(array($this->assert, $assertion), $arguments); - } catch (\Exception $e) { + } catch (ExpectationException $e) { $this->fail('Correct assertion should not throw an exception: '.$e->getMessage()); } } - protected function assertWrongAssertion($assertion, $arguments, $exceptionClass, $exceptionMessage) + private function assertWrongAssertion($assertion, $arguments, $exceptionClass, $exceptionMessage) { + if ('Behat\Mink\Exception\ExpectationException' !== $exceptionClass && !is_subclass_of($exceptionClass, 'Behat\Mink\Exception\ExpectationException')) { + throw new \LogicException('Wrong expected exception for the failed assertion. It should be a Behat\Mink\Exception\ExpectationException.'); + } + try { call_user_func_array(array($this->assert, $assertion), $arguments); $this->fail('Wrong assertion should throw an exception'); - } catch (\Exception $e) { + } catch (ExpectationException $e) { $this->assertInstanceOf($exceptionClass, $e); $this->assertSame($exceptionMessage, $e->getMessage()); } diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index f4ab02be30b..e1c8580f77b 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -21,5 +21,4 @@ return array( 'PHPQRCode' => array($vendorDir . '/aferrandini/phpqrcode/lib'), 'Less' => array($vendorDir . '/oyejorge/less.php/lib'), 'Behat\\Mink\\Driver' => array($vendorDir . '/behat/mink-zombie-driver/src'), - 'Behat\\Mink' => array($vendorDir . '/behat/mink/src'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index b265c64a22f..21c71158886 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,4 +6,5 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'Behat\\Mink\\' => array($vendorDir . '/behat/mink/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 12fe88897e0..9d32c3e9002 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit33a49fb77f37eff1109c166f3c8fbb99 +class ComposerAutoloaderInit66b0b660d01ce78c00a4156c126432d3 { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit33a49fb77f37eff1109c166f3c8fbb99 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit33a49fb77f37eff1109c166f3c8fbb99', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit66b0b660d01ce78c00a4156c126432d3', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit33a49fb77f37eff1109c166f3c8fbb99', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit66b0b660d01ce78c00a4156c126432d3', 'loadClassLoader')); $includePaths = require __DIR__ . '/include_paths.php'; array_push($includePaths, get_include_path()); @@ -48,7 +48,7 @@ class ComposerAutoloaderInit33a49fb77f37eff1109c166f3c8fbb99 } } -function composerRequire33a49fb77f37eff1109c166f3c8fbb99($file) +function composerRequire66b0b660d01ce78c00a4156c126432d3($file) { require $file; } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 22399313e7a..c7f607258cf 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -669,54 +669,6 @@ "issues": "https://github.com/zendframework/ZendService_ReCaptcha/issues" } }, - { - "name": "vufind-org/vufindhttp", - "version": "v1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/vufind-org/vufindhttp.git", - "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vufind-org/vufindhttp/zipball/2f56535bd3c306747ecf89ecea33c798f16f8c4e", - "reference": "2f56535bd3c306747ecf89ecea33c798f16f8c4e", - "shasum": "" - }, - "require": { - "zendframework/zend-http": "2.2.*" - }, - "require-dev": { - "zendframework/zend-uri": "2.2.*" - }, - "time": "2014-10-16 14:38:35", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "VuFindHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0" - ], - "authors": [ - { - "name": "David Maus", - "email": "maus@hab.de", - "role": "Developer" - }, - { - "name": "Demian Katz", - "email": "demian.katz@villanova.edu", - "role": "Maintainer" - } - ], - "description": "VuFind 2.x HTTP service library", - "homepage": "http://vufind.org/" - }, { "name": "vufind-org/vufindcode", "version": "v1.0.2", @@ -755,63 +707,6 @@ ], "description": "Class for representing ISBNs (a VuFind support library)" }, - { - "name": "behat/mink", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/Behat/Mink.git", - "reference": "090900a0049c441f1e072bbd837db4079b2250c5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Behat/Mink/zipball/090900a0049c441f1e072bbd837db4079b2250c5", - "reference": "090900a0049c441f1e072bbd837db4079b2250c5", - "shasum": "" - }, - "require": { - "php": ">=5.3.1", - "symfony/css-selector": "~2.0" - }, - "suggest": { - "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", - "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", - "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", - "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" - }, - "time": "2014-09-26 09:25:05", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.6.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Behat\\Mink": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - } - ], - "description": "Web acceptance testing framework for PHP 5.3", - "homepage": "http://mink.behat.org/", - "keywords": [ - "browser", - "testing", - "web" - ] - }, { "name": "behat/mink-zombie-driver", "version": "v1.2.0", @@ -937,55 +832,6 @@ "service proxies" ] }, - { - "name": "symfony/yaml", - "version": "v2.6.3", - "version_normalized": "2.6.3.0", - "target-dir": "Symfony/Component/Yaml", - "source": { - "type": "git", - "url": "https://github.com/symfony/Yaml.git", - "reference": "82462a90848a52c2533aa6b598b107d68076b018" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", - "reference": "82462a90848a52c2533aa6b598b107d68076b018", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-01-03 15:33:07", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.6-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - } - ], - "description": "Symfony Yaml Component", - "homepage": "http://symfony.com" - }, { "name": "zendframework/zendframework", "version": "2.2.9", @@ -1107,10 +953,107 @@ "issues": "https://github.com/zendframework/zf2/issues" } }, + { + "name": "symfony/yaml", + "version": "v2.6.4", + "version_normalized": "2.6.4.0", + "target-dir": "Symfony/Component/Yaml", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/60ed7751671113cf1ee7d7778e691642c2e9acd8", + "reference": "60ed7751671113cf1ee7d7778e691642c2e9acd8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2015-01-25 04:39:26", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.6-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "http://symfony.com/contributors" + }, + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Symfony Yaml Component", + "homepage": "http://symfony.com" + }, + { + "name": "vufind-org/vufindhttp", + "version": "v1.0.1", + "version_normalized": "1.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/vufind-org/vufindhttp.git", + "reference": "ddedf7636f7e8d3fff529157dbc9aa8a2d0ea210" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vufind-org/vufindhttp/zipball/ddedf7636f7e8d3fff529157dbc9aa8a2d0ea210", + "reference": "ddedf7636f7e8d3fff529157dbc9aa8a2d0ea210", + "shasum": "" + }, + "require": { + "zendframework/zend-http": "2.2.*" + }, + "require-dev": { + "zendframework/zend-uri": "2.2.*" + }, + "time": "2015-02-05 17:26:35", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "VuFindHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "David Maus", + "email": "maus@hab.de", + "role": "Developer" + }, + { + "name": "Demian Katz", + "email": "demian.katz@villanova.edu", + "role": "Maintainer" + } + ], + "description": "VuFind 2.x HTTP service library", + "homepage": "http://vufind.org/" + }, { "name": "symfony/css-selector", - "version": "v2.6.3", - "version_normalized": "2.6.3.0", + "version": "v2.6.4", + "version_normalized": "2.6.4.0", "target-dir": "Symfony/Component/CssSelector", "source": { "type": "git", @@ -1160,26 +1103,83 @@ "description": "Symfony CssSelector Component", "homepage": "http://symfony.com" }, + { + "name": "behat/mink", + "version": "v1.6.1", + "version_normalized": "1.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/minkphp/Mink.git", + "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/minkphp/Mink/zipball/8b68523a339ec991bcd638b39dc8f04f808da88a", + "reference": "8b68523a339ec991bcd638b39dc8f04f808da88a", + "shasum": "" + }, + "require": { + "php": ">=5.3.1", + "symfony/css-selector": "~2.0" + }, + "suggest": { + "behat/mink-browserkit-driver": "extremely fast headless driver for Symfony\\Kernel-based apps (Sf2, Silex)", + "behat/mink-goutte-driver": "fast headless driver for any app without JS emulation", + "behat/mink-selenium2-driver": "slow, but JS-enabled driver for any app (requires Selenium2)", + "behat/mink-zombie-driver": "fast and JS-enabled headless driver for any app (requires node.js)" + }, + "time": "2015-02-04 17:02:06", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Behat\\Mink\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + } + ], + "description": "Browser controller/emulator abstraction for PHP", + "homepage": "http://mink.behat.org/", + "keywords": [ + "browser", + "testing", + "web" + ] + }, { "name": "symfony/process", - "version": "v2.6.3", - "version_normalized": "2.6.3.0", + "version": "v2.6.4", + "version_normalized": "2.6.4.0", "target-dir": "Symfony/Component/Process", "source": { "type": "git", "url": "https://github.com/symfony/Process.git", - "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92" + "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Process/zipball/319794f611bd8bdefbac72beb3f05e847f8ebc92", - "reference": "319794f611bd8bdefbac72beb3f05e847f8ebc92", + "url": "https://api.github.com/repos/symfony/Process/zipball/ecfc23e89d9967999fa5f60a1e9af7384396e9ae", + "reference": "ecfc23e89d9967999fa5f60a1e9af7384396e9ae", "shasum": "" }, "require": { "php": ">=5.3.3" }, - "time": "2015-01-06 22:47:52", + "time": "2015-01-25 04:39:26", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php b/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php index 6150d4a7094..b3841031c4c 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php +++ b/vendor/symfony/process/Symfony/Component/Process/Pipes/UnixPipes.php @@ -172,7 +172,7 @@ class UnixPipes extends AbstractPipes } if (null !== $w && 0 < count($w)) { - while ($len = strlen($this->inputBuffer)) { + while (strlen($this->inputBuffer)) { $written = fwrite($w[0], $this->inputBuffer, 2 << 18); // write 512k if ($written > 0) { $this->inputBuffer = (string) substr($this->inputBuffer, $written); diff --git a/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php b/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php index 86cde67d025..01dd5d0600f 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php +++ b/vendor/symfony/process/Symfony/Component/Process/Pipes/WindowsPipes.php @@ -235,7 +235,7 @@ class WindowsPipes extends AbstractPipes } if (null !== $w && 0 < count($w)) { - while ($len = strlen($this->inputBuffer)) { + while (strlen($this->inputBuffer)) { $written = fwrite($w[0], $this->inputBuffer, 2 << 18); if ($written > 0) { $this->inputBuffer = (string) substr($this->inputBuffer, $written); diff --git a/vendor/symfony/process/Symfony/Component/Process/Process.php b/vendor/symfony/process/Symfony/Component/Process/Process.php index bbbc9a018fd..ece751d17e8 100644 --- a/vendor/symfony/process/Symfony/Component/Process/Process.php +++ b/vendor/symfony/process/Symfony/Component/Process/Process.php @@ -1290,8 +1290,7 @@ class Process { $that = $this; $out = self::OUT; - $err = self::ERR; - $callback = function ($type, $data) use ($that, $callback, $out, $err) { + $callback = function ($type, $data) use ($that, $callback, $out) { if ($out == $type) { $that->addOutput($data); } else { diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php index 6f9785886f1..f4987652aa5 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Escaper.php @@ -72,6 +72,14 @@ class Escaper */ public static function requiresSingleQuoting($value) { + // Determines if a PHP value is entirely composed of a value that would + // require single quoting in YAML. + if (in_array(strtolower($value), array('null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'))) { + return true; + } + + // Determines if the PHP value contains any single characters that would + // cause it to require single quoting in YAML. return preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` ]/x', $value); } diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php index aec52e6295e..302942e02e1 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Inline.php @@ -144,15 +144,13 @@ class Inline } return $repr; + case '' == $value: + return "''"; case Escaper::requiresDoubleQuoting($value): return Escaper::escapeWithDoubleQuotes($value); case Escaper::requiresSingleQuoting($value): - return Escaper::escapeWithSingleQuotes($value); - case '' == $value: - return "''"; case preg_match(self::getTimestampRegex(), $value): - case in_array(strtolower($value), array('null', '~', 'true', 'false')): - return "'$value'"; + return Escaper::escapeWithSingleQuotes($value); default: return $value; } diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php index 23afb17e88a..e9a94d7785d 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Parser.php @@ -98,7 +98,6 @@ class Parser $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { if (isset($values['leadspaces']) - && ' ' == $values['leadspaces'] && preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches) ) { // this is a compact notation element, add to next block and parse @@ -108,7 +107,7 @@ class Parser $block = $values['value']; if ($this->isNextLineIndented()) { - $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2); + $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1); } $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport, $objectForMap); @@ -349,7 +348,14 @@ class Parser $newIndent = $indentation; } - $data = array(substr($this->currentLine, $newIndent)); + $data = array(); + if ($this->getCurrentLineIndentation() >= $newIndent) { + $data[] = substr($this->currentLine, $newIndent); + } else { + $this->moveToPreviousLine(); + + return; + } if ($inSequence && $oldLineIndentation === $newIndent && '-' === $data[0][0]) { // the previous line contained a dash but no item content, this line is a sequence item with the same indentation @@ -372,7 +378,7 @@ class Parser $removeComments = !preg_match($removeCommentsPattern, $this->currentLine); } - if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine)) { + if ($isItUnindentedCollection && !$this->isStringUnIndentedCollectionItem($this->currentLine) && $newIndent === $indent) { $this->moveToPreviousLine(); break; } @@ -623,7 +629,7 @@ class Parser // strip YAML header $count = 0; - $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#su', '', $value, -1, $count); + $value = preg_replace('#^\%YAML[: ][\d\.]+.*\n#u', '', $value, -1, $count); $this->offset += $count; // remove leading comments diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml index fd8ad7ed448..0c96108e991 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/Fixtures/unindentedCollections.yml @@ -60,3 +60,23 @@ yaml: | foo: bar php: | array('collection' => array('key' => array('a', 'b', 'c'), 'foo' => 'bar')) +--- +test: Shortcut Key after unindented collection +brief: > + Key/value after unindented collection +yaml: | + collection: + - key: foo + foo: bar +php: | + array('collection' => array(array('key' => 'foo', 'foo' => 'bar'))) +--- +test: Shortcut Key after unindented collection with custom spaces +brief: > + Key/value after unindented collection +yaml: | + collection: + - key: foo + foo: bar +php: | + array('collection' => array(array('key' => 'foo', 'foo' => 'bar'))) diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php index 7f1876d7a95..ad5aac3ff83 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/InlineTest.php @@ -194,6 +194,14 @@ class InlineTest extends \PHPUnit_Framework_TestCase array("'#cfcfcf'", '#cfcfcf'), array('::form_base.html.twig', '::form_base.html.twig'), + // Pre-YAML-1.2 booleans + array("'y'", 'y'), + array("'n'", 'n'), + array("'yes'", 'yes'), + array("'no'", 'no'), + array("'on'", 'on'), + array("'off'", 'off'), + array('2007-10-30', mktime(0, 0, 0, 10, 30, 2007)), array('2007-10-30T02:59:43Z', gmmktime(2, 59, 43, 10, 30, 2007)), array('2007-10-30 02:59:43 Z', gmmktime(2, 59, 43, 10, 30, 2007)), @@ -339,6 +347,14 @@ class InlineTest extends \PHPUnit_Framework_TestCase array("'-dash'", '-dash'), array("'-'", '-'), + // Pre-YAML-1.2 booleans + array("'y'", 'y'), + array("'n'", 'n'), + array("'yes'", 'yes'), + array("'no'", 'no'), + array("'on'", 'on'), + array("'off'", 'off'), + // sequences array('[foo, bar, false, null, 12]', array('foo', 'bar', false, null, 12)), array('[\'foo,bar\', \'foo bar\']', array('foo,bar', 'foo bar')), diff --git a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php index d735ec6fde9..553d2fb5de5 100644 --- a/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php +++ b/vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php @@ -475,6 +475,22 @@ collection: -item2 -item3 +EOF; + + $this->parser->parse($yaml); + } + + /** + * @expectedException \Symfony\Component\Yaml\Exception\ParseException + */ + public function testShortcutKeyUnindentedCollectionException() + { + $yaml = <<<EOF + +collection: +- key: foo + foo: bar + EOF; $this->parser->parse($yaml); @@ -697,6 +713,17 @@ map_in_map: { foo: { bar: *var } } EOF )); } + + public function testYamlDirective() + { + $yaml = <<<EOF +%YAML 1.2 +--- +foo: 1 +bar: 2 +EOF; + $this->assertEquals(array('foo' => 1, 'bar' => 2), $this->parser->parse($yaml)); + } } class B diff --git a/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpService.php b/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpService.php index 553c023125f..7bf3f9d41c1 100644 --- a/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpService.php +++ b/vendor/vufind-org/vufindhttp/src/VuFindHttp/HttpService.php @@ -115,11 +115,13 @@ class HttpService implements HttpServiceInterface * @param string $url Request URL * @param array $params Request parameters * @param float $timeout Request timeout in seconds + * @param array $headers Request headers * * @return \Zend\Http\Response */ - public function get($url, array $params = array(), $timeout = null) - { + public function get($url, array $params = array(), $timeout = null, + array $headers = array() + ) { if ($params) { $query = $this->createQueryString($params); if (strpos($url, '?') !== false) { @@ -130,6 +132,9 @@ class HttpService implements HttpServiceInterface } $client = $this->createClient($url, \Zend\Http\Request::METHOD_GET, $timeout); + if ($headers) { + $client->setHeaders($headers); + } return $this->send($client); } @@ -284,4 +289,4 @@ class HttpService implements HttpServiceInterface return preg_match(self::LOCAL_ADDRESS_RE, $host); } -} \ No newline at end of file +} diff --git a/vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php b/vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php index bcd61e0d73e..0e3ea2a65d0 100644 --- a/vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php +++ b/vendor/vufind-org/vufindhttp/tests/unit-tests/src/VuFindTest/HttpServiceTest.php @@ -128,6 +128,31 @@ class ProxyServiceTest extends \PHPUnit_Framework_TestCase $service->get('http://example.tld?foo=bar', array('bar=baz')); } + /** + * Test GET request appends headers. + * + * @return void + */ + public function testGetAppendsHeaders() + { + $service = new Service(); + $adapter = $this->getMock('Zend\Http\Client\Adapter\Test', array('write')); + $adapter->expects($this->once()) + ->method('write') + ->with( + $this->equalTo('GET'), + $this->equalTo( + new \Zend\Uri\Http('http://example.tld?foo=bar') + ), + $this->equalTo('1.1'), + $this->equalTo( + array('Host' => 'example.tld', 'Connection' => 'close', 'Accept-Encoding' => 'gzip, deflate','User-Agent' => 'Zend\Http\Client', 'Content-Type' => 'application/json', 'Accept' => 'application/json') + ) + ); + $service->setDefaultAdapter($adapter); + $service->get('http://example.tld', array('foo=bar'), 'test', array("Content-type: application/json", "Accept: application/json")); + } + /** * Test POST request of form data. * @@ -287,4 +312,4 @@ class ProxyServiceTest extends \PHPUnit_Framework_TestCase $reflectionProperty->setAccessible(true); return $reflectionProperty->getValue($object); } -} \ No newline at end of file +} -- GitLab