Skip to content
Permalink
Browse files

Merge branch '8.2'

  • Loading branch information...
sebastianbergmann committed Jul 2, 2019
2 parents 29f3849 + ee343b9 commit 23544ff4704bf2d85d7327fa2c31357a355c2e34
@@ -2,6 +2,12 @@

All notable changes of the PHPUnit 7.5 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [7.5.14] - 2019-MM-DD

### Fixed

* Fixed [#3743](https://github.com/sebastianbergmann/phpunit/issues/3743): `EmptyIterator` instances are not handled correctly by `Count` and `IsEmpty` constraints

## [7.5.13] - 2019-06-19

### Fixed
@@ -126,6 +132,7 @@ All notable changes of the PHPUnit 7.5 release series are documented in this fil
* Fixed [#3429](https://github.com/sebastianbergmann/phpunit/pull/3429): Inefficient loop in `getHookMethods()`
* Fixed [#3437](https://github.com/sebastianbergmann/phpunit/pull/3437): JUnit logger skips PHPT tests

[7.5.14]: https://github.com/sebastianbergmann/phpunit/compare/7.5.13...7.5.14
[7.5.13]: https://github.com/sebastianbergmann/phpunit/compare/7.5.12...7.5.13
[7.5.12]: https://github.com/sebastianbergmann/phpunit/compare/7.5.11...7.5.12
[7.5.11]: https://github.com/sebastianbergmann/phpunit/compare/7.5.10...7.5.11
@@ -49,6 +49,10 @@ protected function matches($other): bool
*/
protected function getCountOf($other): ?int
{
if ($other instanceof \EmptyIterator) {
return 0;
}
if ($other instanceof Countable || \is_array($other)) {
return \count($other);
}
@@ -32,6 +32,10 @@ public function toString(): string
*/
protected function matches($other): bool
{
if ($other instanceof \EmptyIterator) {
return true;
}
if ($other instanceof Countable) {
return \count($other) === 0;
}
@@ -173,4 +173,14 @@ public function testCountEvaluateReturnsNullWithNonCountableAndNonTraversableOth
);
}
}
/**
* @ticket https://github.com/sebastianbergmann/phpunit/issues/3743
*/
public function test_EmptyIterator_is_handled_correctly(): void
{
$constraint = new Count(0);
$this->assertTrue($constraint->evaluate(new \EmptyIterator, '', true));
}
}
@@ -67,4 +67,14 @@ public function testConstraintIsEmpty2(): void
$this->fail();
}
/**
* @ticket https://github.com/sebastianbergmann/phpunit/issues/3743
*/
public function test_EmptyIterator_is_handled_correctly(): void
{
$constraint = new IsEmpty;
$this->assertTrue($constraint->evaluate(new \EmptyIterator, '', true));
}
}

0 comments on commit 23544ff

Please sign in to comment.
You can’t perform that action at this time.