This commit is contained in:
Sampanna Rimal
2024-09-04 12:22:04 +05:45
parent 53c0140f58
commit 82fab174dc
203 changed files with 4255 additions and 1343 deletions

View File

@ -2,6 +2,11 @@
All notable changes of the PHPUnit 10.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
## [10.5.20] - 2024-04-24
* [#5771](https://github.com/sebastianbergmann/phpunit/issues/5771): JUnit XML logger may crash when test that is run in separate process exits unexpectedly
* [#5819](https://github.com/sebastianbergmann/phpunit/issues/5819): Duplicate keys from different data providers are not handled properly
## [10.5.19] - 2024-04-17
### Fixed
@ -199,6 +204,7 @@ All notable changes of the PHPUnit 10.5 release series are documented in this fi
* [#5563](https://github.com/sebastianbergmann/phpunit/issues/5563): `createMockForIntersectionOfInterfaces()` does not automatically register mock object for expectation verification
[10.5.20]: https://github.com/sebastianbergmann/phpunit/compare/10.5.19...10.5.20
[10.5.19]: https://github.com/sebastianbergmann/phpunit/compare/10.5.18...10.5.19
[10.5.18]: https://github.com/sebastianbergmann/phpunit/compare/10.5.17...10.5.18
[10.5.17]: https://github.com/sebastianbergmann/phpunit/compare/10.5.16...10.5.17

View File

@ -202,7 +202,7 @@ final class JunitXmlLogger
*/
public function testFinished(Finished $event): void
{
if ($this->preparationFailed) {
if (!$this->prepared || $this->preparationFailed) {
return;
}

View File

@ -10,7 +10,6 @@
namespace PHPUnit\Metadata\Api;
use function array_key_exists;
use function array_merge;
use function assert;
use function explode;
use function is_array;
@ -39,7 +38,6 @@ use PHPUnit\Util\Reflection;
use ReflectionClass;
use ReflectionMethod;
use Throwable;
use Traversable;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
@ -176,34 +174,25 @@ final class DataProvider
);
}
if ($data instanceof Traversable) {
$origData = $data;
$data = [];
foreach ($data as $key => $value) {
if (is_int($key)) {
$result[] = $value;
} elseif (array_key_exists($key, $result)) {
Event\Facade::emitter()->dataProviderMethodFinished(
$testMethod,
...$methodsCalled,
);
foreach ($origData as $key => $value) {
if (is_int($key)) {
$data[] = $value;
} elseif (array_key_exists($key, $data)) {
Event\Facade::emitter()->dataProviderMethodFinished(
$testMethod,
...$methodsCalled,
);
throw new InvalidDataProviderException(
sprintf(
'The key "%s" has already been defined by a previous data provider',
$key,
),
);
} else {
$data[$key] = $value;
}
throw new InvalidDataProviderException(
sprintf(
'The key "%s" has already been defined by a previous data provider',
$key,
),
);
} else {
$result[$key] = $value;
}
}
if (is_array($data)) {
$result = array_merge($result, $data);
}
}
Event\Facade::emitter()->dataProviderMethodFinished(

View File

@ -34,7 +34,7 @@ final class Version
}
if (self::$version === '') {
self::$version = (new VersionId('10.5.19', dirname(__DIR__, 2)))->asString();
self::$version = (new VersionId('10.5.20', dirname(__DIR__, 2)))->asString();
}
return self::$version;