Skip to content

Commit

Permalink
Merge branch '8.5' into 9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 4, 2021
2 parents 32dbdf1 + 757f003 commit 6a0056b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 58 deletions.
1 change: 1 addition & 0 deletions ChangeLog-8.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
* [#4663](https://github.com/sebastianbergmann/phpunit/issues/4663): `TestCase::expectError()` works on PHP 7.3, but not on PHP >= 7.4
* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default
* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly
* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev

## [8.5.15] - 2021-03-17

Expand Down
1 change: 1 addition & 0 deletions ChangeLog-9.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes of the PHPUnit 9.5 release series are documented in this fil
* [#4632](https://github.com/sebastianbergmann/phpunit/issues/4632): TestDox result printer does not handle repeated test execution correctly
* [#4678](https://github.com/sebastianbergmann/phpunit/pull/4678): Stubbed methods with `iterable` return types should return empty array by default
* [#4692](https://github.com/sebastianbergmann/phpunit/issues/4692): Annotations in single-line doc-comments are not handled correctly
* [#4694](https://github.com/sebastianbergmann/phpunit/issues/4694): `TestCase::getMockFromWsdl()` does not work with PHP 8.1-dev

## [9.5.4] - 2021-03-23

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"sebastian/global-state": "^5.0.1",
"sebastian/object-enumerator": "^4.0.3",
"sebastian/resource-operations": "^3.0.3",
"sebastian/type": "^2.3",
"sebastian/type": "^2.3.2",
"sebastian/version": "^3.0.2"
},
"require-dev": {
Expand Down
4 changes: 2 additions & 2 deletions tests/end-to-end/regression/GitHub/1337.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ PHPUnit\TextUI\Command::main();
--EXPECTF--
PHPUnit %s by Sebastian Bergmann and contributors.

.. 2 / 2 (100%)
. 1 / 1 (100%)

Time: %s, Memory: %s

OK (2 tests, 2 assertions)
OK (1 test, 1 assertion)
3 changes: 2 additions & 1 deletion tests/end-to-end/regression/GitHub/1337/Issue1337Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public function dataProvider()
{
return [
'c:\\' => [true],
0.9 => [true],
// The following is commented out because it no longer works in PHP >= 8.1
//0.9 => [true],
];
}
}
54 changes: 0 additions & 54 deletions tests/unit/Framework/TestBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*/
namespace PHPUnit\Framework;

use function assert;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\TestFixture\EmptyDataProviderTest;
use PHPUnit\TestFixture\ModifiedConstructorTestCase;
use PHPUnit\TestFixture\TestWithAnnotations;
Expand All @@ -21,58 +19,6 @@
*/
final class TestBuilderTest extends TestCase
{
public function testCreateTestForConstructorlessTestClass(): void
{
$reflector = $this->getMockBuilder(ReflectionClass::class)
->setConstructorArgs([$this])
->getMock();

assert($reflector instanceof MockObject);
assert($reflector instanceof ReflectionClass);

$reflector->expects($this->once())
->method('getConstructor')
->willReturn(null);

$reflector->expects($this->once())
->method('isInstantiable')
->willReturn(true);

$reflector->expects($this->once())
->method('getName')
->willReturn(__CLASS__);

$this->expectException(Exception::class);
$this->expectExceptionMessage('No valid test provided.');

(new TestBuilder)->build($reflector, 'TestForConstructorlessTestClass');
}

public function testCreateTestForNotInstantiableTestClass(): void
{
$reflector = $this->getMockBuilder(ReflectionClass::class)
->setConstructorArgs([$this])
->getMock();

assert($reflector instanceof MockObject);
assert($reflector instanceof ReflectionClass);

$reflector->expects($this->once())
->method('isInstantiable')
->willReturn(false);

$reflector->expects($this->once())
->method('getName')
->willReturn('foo');

$test = (new TestBuilder)->build($reflector, 'TestForNonInstantiableTestClass');

$this->assertInstanceOf(ErrorTestCase::class, $test);

/* @var ErrorTestCase $test */
$this->assertSame('Cannot instantiate class "foo".', $test->getMessage());
}

public function testCreateTestForTestClassWithModifiedConstructor(): void
{
$test = (new TestBuilder)->build(new ReflectionClass(ModifiedConstructorTestCase::class), 'testCase');
Expand Down

0 comments on commit 6a0056b

Please sign in to comment.