composer-update-patch

This commit is contained in:
Manish Verma
2016-11-03 05:44:29 +05:30
parent 2dca47f5a4
commit 5d49d384a0
5118 changed files with 51603 additions and 122575 deletions

View File

@@ -1,4 +1,11 @@
2.5.2 / 2017-09-04
2.5.3 / 2016-09-26
==================
* [fixed] Accidental linebreaks in spec name are not allowed (@randompixel)
* [fixed] Throwable can be passed as instance to shouldThrow (@jameshalsall)
* [performance] Phar version now has an optimised autoloader
2.5.2 / 2016-09-04
==================
* [fixed] Exceptions are properly highlighted in error messages (@ciaranmcnulty)

View File

@@ -7,7 +7,7 @@ build-phar:
@echo "--> Cleaning vendor directory"
rm -Rfv vendor
@echo "--> Installing dependencies without dev"
composer install --no-dev
composer install --no-dev -o
@echo "--> Building Phar"
box build
@echo "--> Success"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env php
<?php
define('PHPSPEC_VERSION', '2.5.2');
define('PHPSPEC_VERSION', '2.5.3');
if (is_file($autoload = getcwd() . '/vendor/autoload.php')) {
require $autoload;

View File

@@ -501,6 +501,18 @@ class PSR0LocatorSpec extends ObjectBehavior
$this->shouldThrow($exception)->duringCreateResource('Namespace/');
}
function it_throws_an_exception_on_PSR0_resource_with_line_breaks_at_end()
{
$this->beConstructedWith('', 'spec', $this->srcPath, $this->specPath);
$exception = new \InvalidArgumentException(
'String "Namespace\Classname'.PHP_EOL.'" is not a valid class name.'.PHP_EOL.
'Please see reference document: https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md'
);
$this->shouldThrow($exception)->duringCreateResource('Namespace\Classname'.PHP_EOL);
}
function it_throws_an_exception_on_PSR4_prefix_not_matching_namespace()
{
$exception = new \InvalidArgumentException(

View File

@@ -33,7 +33,7 @@ class ThrowMatcherSpec extends ObjectBehavior
$this->positiveMatch('throw', $arr, array('\Exception'))->during('ksort', array());
}
function it_accepts_a_method_during_which_an_error_should_be_thrown(ArrayObject $arr)
function it_accepts_a_method_during_which_an_error_specified_by_class_name_should_be_thrown(ArrayObject $arr)
{
if (!class_exists('\Error')) {
throw new SkippingException('The class Error, introduced in PHP 7, does not exist');
@@ -44,6 +44,17 @@ class ThrowMatcherSpec extends ObjectBehavior
$this->positiveMatch('throw', $arr, array('\Error'))->during('ksort', array());
}
function it_accepts_a_method_during_which_an_error_specified_by_instance_should_be_thrown(ArrayObject $arr)
{
if (!class_exists('\Error')) {
throw new SkippingException('The class Error, introduced in PHP 7, does not exist');
}
$arr->ksort()->will(function(){ throw new \Error(); });
$this->positiveMatch('throw', $arr, array(new \Error()))->during('ksort', array());
}
function it_accepts_a_method_during_which_an_exception_should_not_be_thrown(ArrayObject $arr)
{
$this->negativeMatch('throw', $arr, array('\Exception'))->during('ksort', array());

View File

@@ -358,7 +358,7 @@ class PSR0Locator implements ResourceLocatorInterface
*/
private function validatePsr0Classname($classname)
{
$pattern = '/^([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*[\/\\\\]?)*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/';
$pattern = '/\A([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*[\/\\\\]?)*[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\z/';
if (!preg_match($pattern, $classname)) {
throw new InvalidArgumentException(

View File

@@ -284,7 +284,7 @@ class ThrowMatcher implements MatcherInterface
}
if (is_object($arguments[0])) {
if (class_exists('\Throwable') && $arguments[0] instanceof \Throwable) {
if ($arguments[0] instanceof \Throwable) {
return $arguments[0];
} elseif ($arguments[0] instanceof \Exception) {
return $arguments[0];