Composer data update

This commit is contained in:
Clemens Schwaighofer
2022-01-06 10:01:52 +09:00
parent 4bac10bb42
commit 5452bffdb4
57 changed files with 1409 additions and 680 deletions

View File

@@ -2,6 +2,18 @@
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [8.5.22] - 2021-12-25
### Changed
* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active
* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2
### Fixed
* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics
* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored
## [8.5.21] - 2021-09-25
### Changed
@@ -178,6 +190,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
[8.5.22]: https://github.com/sebastianbergmann/phpunit/compare/8.5.21...8.5.22
[8.5.21]: https://github.com/sebastianbergmann/phpunit/compare/8.5.20...8.5.21
[8.5.20]: https://github.com/sebastianbergmann/phpunit/compare/8.5.19...8.5.20
[8.5.19]: https://github.com/sebastianbergmann/phpunit/compare/8.5.18...8.5.19

View File

@@ -2,6 +2,18 @@
All notable changes of the PHPUnit 9.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [9.5.11] - 2021-12-25
### Changed
* [#4812](https://github.com/sebastianbergmann/phpunit/issues/4812): Do not enforce time limits when a debugging session through DBGp is active
* [#4835](https://github.com/sebastianbergmann/phpunit/issues/4835): Support for `$GLOBALS['_composer_autoload_path']` introduced in Composer 2.2
### Fixed
* [#4840](https://github.com/sebastianbergmann/phpunit/pull/4840): TestDox prettifying for class names does not correctly handle diacritics
* [#4846](https://github.com/sebastianbergmann/phpunit/pull/4846): Composer proxy script is not ignored
## [9.5.10] - 2021-09-25
### Changed
@@ -91,6 +103,7 @@ All notable changes of the PHPUnit 9.5 release series are documented in this fil
* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly
[9.5.11]: https://github.com/sebastianbergmann/phpunit/compare/9.5.10...9.5.11
[9.5.10]: https://github.com/sebastianbergmann/phpunit/compare/9.5.9...9.5.10
[9.5.9]: https://github.com/sebastianbergmann/phpunit/compare/9.5.8...9.5.9
[9.5.8]: https://github.com/sebastianbergmann/phpunit/compare/9.5.7...9.5.8

View File

@@ -58,15 +58,21 @@ if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
if (file_exists($file)) {
define('PHPUNIT_COMPOSER_INSTALL', $file);
if (isset($GLOBALS['_composer_autoload_path'])) {
define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']);
break;
unset($GLOBALS['_composer_autoload_path']);
} else {
foreach (array(__DIR__ . '/../../autoload.php', __DIR__ . '/../vendor/autoload.php', __DIR__ . '/vendor/autoload.php') as $file) {
if (file_exists($file)) {
define('PHPUNIT_COMPOSER_INSTALL', $file);
break;
}
}
}
unset($file);
unset($file);
}
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
fwrite(

View File

@@ -514,6 +514,24 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T
{
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between setUp() and test.
*/
protected function assertPreConditions(): void
{
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between test and tearDown().
*/
protected function assertPostConditions(): void
{
}
/**
* This method is called after each test.
*/
@@ -1955,24 +1973,6 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T
return new TestResult;
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between setUp() and test.
*/
protected function assertPreConditions(): void
{
}
/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between test and tearDown().
*/
protected function assertPostConditions(): void
{
}
/**
* This method is called when a test method did not execute successfully.
*

View File

@@ -14,6 +14,10 @@ use function count;
use function function_exists;
use function get_class;
use function sprintf;
use function xdebug_get_monitored_functions;
use function xdebug_is_debugger_active;
use function xdebug_start_function_monitor;
use function xdebug_stop_function_monitor;
use AssertionError;
use Countable;
use Error;
@@ -452,7 +456,7 @@ final class TestResult implements Countable
$this->passed[$key] = [
'result' => $test->getResult(),
'size' => \PHPUnit\Util\Test::getSize(
'size' => TestUtil::getSize(
$class,
$test->getName(false)
),
@@ -636,12 +640,15 @@ final class TestResult implements Countable
{
Assert::resetCount();
$size = TestUtil::UNKNOWN;
if ($test instanceof TestCase) {
$test->setRegisterMockObjectsFromTestArgumentsRecursively(
$this->registerMockObjectsFromTestArgumentsRecursively
);
$isAnyCoverageRequired = TestUtil::requiresCodeCoverageDataCollection($test);
$size = $test->getSize();
}
$error = false;
@@ -676,7 +683,7 @@ final class TestResult implements Countable
$monitorFunctions = $this->beStrictAboutResourceUsageDuringSmallTests &&
!$test instanceof ErrorTestCase &&
!$test instanceof WarningTestCase &&
$test->getSize() === \PHPUnit\Util\Test::SMALL &&
$size === TestUtil::SMALL &&
function_exists('xdebug_start_function_monitor');
if ($monitorFunctions) {
@@ -692,29 +699,26 @@ final class TestResult implements Countable
if (!$test instanceof ErrorTestCase &&
!$test instanceof WarningTestCase &&
$this->enforceTimeLimit &&
($this->defaultTimeLimit || $test->getSize() != \PHPUnit\Util\Test::UNKNOWN) &&
$this->shouldTimeLimitBeEnforced($size) &&
$invoker->canInvokeWithTimeout()) {
switch ($test->getSize()) {
case \PHPUnit\Util\Test::SMALL:
switch ($size) {
case TestUtil::SMALL:
$_timeout = $this->timeoutForSmallTests;
break;
case \PHPUnit\Util\Test::MEDIUM:
case TestUtil::MEDIUM:
$_timeout = $this->timeoutForMediumTests;
break;
case \PHPUnit\Util\Test::LARGE:
case TestUtil::LARGE:
$_timeout = $this->timeoutForLargeTests;
break;
case \PHPUnit\Util\Test::UNKNOWN:
default:
$_timeout = $this->defaultTimeLimit;
break;
}
$invoker->invoke([$test, 'runBare'], [], $_timeout);
@@ -829,12 +833,12 @@ final class TestResult implements Countable
if ($append && $test instanceof TestCase) {
try {
$linesToBeCovered = \PHPUnit\Util\Test::getLinesToBeCovered(
$linesToBeCovered = TestUtil::getLinesToBeCovered(
get_class($test),
$test->getName(false)
);
$linesToBeUsed = \PHPUnit\Util\Test::getLinesToBeUsed(
$linesToBeUsed = TestUtil::getLinesToBeUsed(
get_class($test),
$test->getName(false)
);
@@ -1286,4 +1290,29 @@ final class TestResult implements Countable
{
$this->warnings[] = new TestFailure($test, $t);
}
private function shouldTimeLimitBeEnforced(int $size): bool
{
if (!$this->enforceTimeLimit) {
return false;
}
if (!(($this->defaultTimeLimit || $size !== TestUtil::UNKNOWN))) {
return false;
}
if (!extension_loaded('pcntl')) {
return false;
}
if (!class_exists(Invoker::class)) {
return false;
}
if (extension_loaded('xdebug') && xdebug_is_debugger_active()) {
return false;
}
return true;
}
}

View File

@@ -41,7 +41,7 @@ final class Version
}
if (self::$version === '') {
self::$version = (new VersionId('9.5.10', dirname(__DIR__, 2)))->getVersion();
self::$version = (new VersionId('9.5.11', dirname(__DIR__, 2)))->getVersion();
}
return self::$version;

View File

@@ -11,6 +11,7 @@ namespace PHPUnit\Util;
use function array_keys;
use function array_reverse;
use function array_shift;
use function defined;
use function get_defined_constants;
use function get_included_files;
@@ -23,6 +24,8 @@ use function preg_match;
use function serialize;
use function sprintf;
use function strpos;
use function strtr;
use function substr;
use function var_export;
use Closure;
@@ -68,7 +71,12 @@ final class GlobalState
}
// Do not process bootstrap script
unset($files[0]);
array_shift($files);
// If bootstrap script was a Composer bin proxy, skip the second entry as well
if (substr(strtr($files[0], '\\', '/'), -24) === '/phpunit/phpunit/phpunit') {
array_shift($files);
}
foreach (array_reverse($files) as $file) {
if (!empty($GLOBALS['__PHPUNIT_ISOLATION_EXCLUDE_LIST']) &&

View File

@@ -26,7 +26,6 @@ use function is_numeric;
use function is_object;
use function is_scalar;
use function is_string;
use function mb_strtolower;
use function ord;
use function preg_quote;
use function preg_replace;
@@ -109,24 +108,7 @@ final class NamePrettifier
$fullyQualifiedName = $className;
}
$result = '';
$wasLowerCase = false;
foreach (range(0, strlen($className) - 1) as $i) {
$isLowerCase = mb_strtolower($className[$i], 'UTF-8') === $className[$i];
if ($wasLowerCase && !$isLowerCase) {
$result .= ' ';
}
$result .= $className[$i];
if ($isLowerCase) {
$wasLowerCase = true;
} else {
$wasLowerCase = false;
}
}
$result = preg_replace('/(?<=[[:lower:]])(?=[[:upper:]])/u', ' ', $className);
if ($fullyQualifiedName !== $className) {
return $result . ' (' . $fullyQualifiedName . ')';