composer update

This commit is contained in:
Manish Verma
2018-12-05 10:50:52 +05:30
parent 9eabcacfa7
commit 4addd1e9c6
3328 changed files with 156676 additions and 138988 deletions

View File

@@ -11,8 +11,12 @@
namespace Symfony\Polyfill\Util;
if (extension_loaded('mbstring')) {
class Binary extends BinaryOnFuncOverload {}
if (\extension_loaded('mbstring')) {
class Binary extends BinaryOnFuncOverload
{
}
} else {
class Binary extends BinaryNoFuncOverload {}
class Binary extends BinaryNoFuncOverload
{
}
}

View File

@@ -81,4 +81,9 @@ class LegacyTestListener extends \PHPUnit_Framework_TestSuite implements \PHPUni
public function endTest(\PHPUnit_Framework_Test $test, $time)
{
}
public static function warning($message)
{
return parent::warning($message);
}
}

View File

@@ -12,10 +12,11 @@
namespace Symfony\Polyfill\Util;
use PHPUnit\Framework\AssertionFailedError;
use PHPUnit\Framework\TestListener as TestListenerInterface;
use PHPUnit\Framework\Test;
use PHPUnit\Framework\TestListener as TestListenerInterface;
use PHPUnit\Framework\TestSuite;
use PHPUnit\Framework\Warning;
use PHPUnit\Framework\WarningTestCase;
if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) {
class_alias('Symfony\Polyfill\Util\LegacyTestListener', 'Symfony\Polyfill\Util\TestListener');
@@ -92,5 +93,10 @@ if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Ve
public function endTest(Test $test, $time)
{
}
public static function warning($message)
{
return parent::warning($message);
}
}
}

View File

@@ -40,17 +40,34 @@ class TestListenerTrait
continue;
}
$testedClass = new \ReflectionClass($m[1].$m[2]);
$bootstrap = new \SplFileObject(dirname($testedClass->getFileName()).'/bootstrap.php');
$bootstrap = new \SplFileObject(\dirname($testedClass->getFileName()).'/bootstrap.php');
$warnings = array();
$defLine = null;
foreach (new \RegexIterator($bootstrap, '/define\(\'/') as $defLine) {
preg_match('/define\(\'(?P<name>.+)\'/', $defLine, $matches);
if (\defined($matches['name'])) {
continue;
}
try {
eval($defLine);
} catch (\PHPUnit_Framework_Exception $ex){
$warnings[] = $TestListener::warning($ex->getMessage());
} catch (\PHPUnit\Framework\Exception $ex) {
$warnings[] = $TestListener::warning($ex->getMessage());
}
}
$bootstrap->rewind();
foreach (new \RegexIterator($bootstrap, '/return p\\\\'.$testedClass->getShortName().'::/') as $defLine) {
if (!preg_match('/^\s*function (?P<name>[^\(]++)(?P<signature>\([^\)]*+\)) \{ (?<return>return p\\\\'.$testedClass->getShortName().'::[^\(]++)(?P<args>\([^\)]*+\)); \}$/', $defLine, $f)) {
if (!preg_match('/^\s*function (?P<name>[^\(]++)(?P<signature>\(.*\)) \{ (?<return>return p\\\\'.$testedClass->getShortName().'::[^\(]++)(?P<args>\([^\)]*+\)); \}$/', $defLine, $f)) {
$warnings[] = $TestListener::warning('Invalid line in bootstrap.php: '.trim($defLine));
continue;
}
$testNamespace = substr($testClass, 0, strrpos($testClass, '\\'));
if (function_exists($testNamespace.'\\'.$f['name'])) {
if (\function_exists($testNamespace.'\\'.$f['name'])) {
continue;
}
@@ -59,10 +76,12 @@ class TestListenerTrait
if ($r->isUserDefined()) {
throw new \ReflectionException();
}
if (false !== strpos($f['signature'], '&')) {
if ('idn_to_ascii' === $f['name'] || 'idn_to_utf8' === $f['name']) {
$defLine = sprintf('return INTL_IDNA_VARIANT_2003 === $variant ? \\%s($domain, $options, $variant) : \\%1$s%s', $f['name'], $f['args']);
} elseif (false !== strpos($f['signature'], '&') && 'idn_to_ascii' !== $f['name'] && 'idn_to_utf8' !== $f['name']) {
$defLine = sprintf('return \\%s%s', $f['name'], $f['args']);
} else {
$defLine = sprintf("return \\call_user_func_array('%s', func_get_args())", $f['name']);
$defLine = sprintf("return \\call_user_func_array('%s', \\func_get_args())", $f['name']);
}
} catch (\ReflectionException $e) {
$defLine = sprintf("throw new \\{$SkippedTestError}('Internal function not found: %s')", $f['name']);