Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up the Test Double generator and runtime #5697

Draft
wants to merge 38 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
dc99c27
Closes #5247
sebastianbergmann Feb 7, 2024
f1ed86e
Closes #5314
sebastianbergmann Feb 7, 2024
2eab30a
Closes #5249
sebastianbergmann Feb 7, 2024
a984f70
Closes #5313
sebastianbergmann Feb 7, 2024
621b178
Closes #5250
sebastianbergmann Feb 7, 2024
dc4e1a4
Closes #5248
sebastianbergmann Feb 7, 2024
1ea1e54
Closes #5246
sebastianbergmann Feb 7, 2024
d47f0f7
Closes #5312
sebastianbergmann Feb 7, 2024
58666ba
Closes #5321
sebastianbergmann Feb 7, 2024
28909f5
Closes #5311
sebastianbergmann Feb 7, 2024
69c25ce
Closes #5316
sebastianbergmann Feb 7, 2024
39ba620
Closes #5310
sebastianbergmann Feb 7, 2024
c13a48a
Closes #5424
sebastianbergmann Feb 7, 2024
d496f23
Delete unused code
sebastianbergmann Feb 7, 2024
0e619d0
Delete events that are no longer emitted
sebastianbergmann Feb 7, 2024
77f366e
Closes #5416
sebastianbergmann Feb 8, 2024
1de4b78
Closes #5536
sebastianbergmann Feb 8, 2024
5160006
Rename variables
sebastianbergmann Feb 8, 2024
d19a6f7
Delete unused code
sebastianbergmann Feb 8, 2024
b351976
Add missing annotations for exceptions
sebastianbergmann Feb 8, 2024
f9958a9
Add parameter type declaration
sebastianbergmann Feb 8, 2024
6ba1608
Simplify
sebastianbergmann Feb 8, 2024
1a2d0c7
We no longer need a separate trait for the method named method
sebastianbergmann Feb 8, 2024
c9237a4
Raise MethodNamedMethodException earlier
sebastianbergmann Feb 8, 2024
de128bc
Add tests
sebastianbergmann Feb 8, 2024
aa6de18
Refactor
sebastianbergmann Feb 8, 2024
d0c02e5
Refactor
sebastianbergmann Feb 13, 2024
b0731fd
Refactor
sebastianbergmann Feb 14, 2024
2aafbfc
Remove redundant condition
sebastianbergmann Apr 12, 2024
1165ebd
Delete code specific to PHP 8.2
sebastianbergmann Apr 12, 2024
86ac2ad
This branch requires PHP 8.3 now
sebastianbergmann Apr 12, 2024
b44bc59
Reorganize
sebastianbergmann Apr 17, 2024
e680724
Fix merge conflict resolution
sebastianbergmann Jul 16, 2024
2478cd1
Remove code that is no longer needed
sebastianbergmann Jul 16, 2024
3bf6f90
Delete unused code
sebastianbergmann Jul 17, 2024
9d85d15
We are no longer calling deprecated methods from this test
sebastianbergmann Jul 19, 2024
db6b3ab
Fix CS/WS issues
sebastianbergmann Sep 5, 2024
753eda6
Update composer.lock
sebastianbergmann Sep 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
name: CI

env:
COMPOSER_ROOT_VERSION: "11.4-dev"
COMPOSER_ROOT_VERSION: "12.0-dev"

permissions:
contents: read
Expand Down Expand Up @@ -110,7 +110,6 @@ jobs:
- windows-latest

php-version:
- "8.2"
- "8.3"
- "8.4"

Expand Down Expand Up @@ -157,7 +156,6 @@ jobs:
- windows-latest

php-version:
- "8.2"
- "8.3"
- "8.4"

Expand Down Expand Up @@ -291,7 +289,6 @@ jobs:
fail-fast: false
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"

Expand Down
4 changes: 2 additions & 2 deletions build/templates/binary-phar-autoload.php.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) {
die(1);
}

if (version_compare('8.2.0', PHP_VERSION, '>')) {
if (version_compare('8.3.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
'PHPUnit X.Y.Z by Sebastian Bergmann and contributors.' . PHP_EOL . PHP_EOL .
'This version of PHPUnit requires PHP >= 8.2.' . PHP_EOL .
'This version of PHPUnit requires PHP >= 8.3.' . PHP_EOL .
'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINARY
Expand Down
9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"prefer-stable": true,
"require": {
"php": ">=8.2",
"php": ">=8.3",
"ext-dom": "*",
"ext-json": "*",
"ext-libxml": "*",
Expand Down Expand Up @@ -50,14 +50,11 @@
},
"config": {
"platform": {
"php": "8.2.0"
"php": "8.3.0"
},
"optimize-autoloader": true,
"sort-packages": true
},
"suggest": {
"ext-soap": "To be able to generate mocks based on WSDL files"
},
"bin": [
"phpunit"
],
Expand All @@ -83,7 +80,7 @@
},
"extra": {
"branch-alias": {
"dev-main": "11.4-dev"
"dev-main": "12.0-dev"
}
}
}
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions phpunit
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ if (!version_compare(PHP_VERSION, PHP_VERSION, '=')) {
die(1);
}

if (version_compare('8.2.0', PHP_VERSION, '>')) {
if (version_compare('8.3.0', PHP_VERSION, '>')) {
fwrite(
STDERR,
sprintf(
'This version of PHPUnit requires PHP >= 8.2.' . PHP_EOL .
'This version of PHPUnit requires PHP >= 8.3.' . PHP_EOL .
'You are using PHP %s (%s).' . PHP_EOL,
PHP_VERSION,
PHP_BINARY
Expand Down
75 changes: 0 additions & 75 deletions src/Event/Emitter/DispatchingEmitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
use PHPUnit\Event\TestSuite\Started as TestSuiteStarted;
use PHPUnit\Event\TestSuite\TestSuite;
use PHPUnit\TextUI\Configuration\Configuration;
use PHPUnit\Util\Exporter;

/**
* @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Expand Down Expand Up @@ -501,62 +500,6 @@ public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfac
);
}

/**
* @param trait-string $traitName
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
public function testCreatedMockObjectForTrait(string $traitName): void
{
$this->dispatcher->dispatch(
new Test\MockObjectForTraitCreated(
$this->telemetryInfo(),
$traitName,
),
);
}

/**
* @param class-string $className
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
public function testCreatedMockObjectForAbstractClass(string $className): void
{
$this->dispatcher->dispatch(
new Test\MockObjectForAbstractClassCreated(
$this->telemetryInfo(),
$className,
),
);
}

/**
* @param class-string $originalClassName
* @param class-string $mockClassName
* @param list<string> $methods
* @param list<mixed> $options
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
public function testCreatedMockObjectFromWsdl(string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options): void
{
$this->dispatcher->dispatch(
new Test\MockObjectFromWsdlCreated(
$this->telemetryInfo(),
$wsdlFile,
$originalClassName,
$mockClassName,
$methods,
$callOriginalConstructor,
$options,
),
);
}

/**
* @param class-string $className
*
Expand All @@ -574,24 +517,6 @@ public function testCreatedPartialMockObject(string $className, string ...$metho
);
}

/**
* @param class-string $className
* @param list<mixed> $constructorArguments
*
* @throws InvalidArgumentException
* @throws UnknownEventTypeException
*/
public function testCreatedTestProxy(string $className, array $constructorArguments): void
{
$this->dispatcher->dispatch(
new Test\TestProxyCreated(
$this->telemetryInfo(),
$className,
Exporter::export($constructorArguments),
),
);
}

/**
* @param class-string $className
*
Expand Down
24 changes: 0 additions & 24 deletions src/Event/Emitter/Emitter.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,35 +117,11 @@ public function testCreatedMockObject(string $className): void;
*/
public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void;

/**
* @param trait-string $traitName
*/
public function testCreatedMockObjectForTrait(string $traitName): void;

/**
* @param class-string $className
*/
public function testCreatedMockObjectForAbstractClass(string $className): void;

/**
* @param class-string $originalClassName
* @param class-string $mockClassName
* @param list<string> $methods
* @param list<mixed> $options
*/
public function testCreatedMockObjectFromWsdl(string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options): void;

/**
* @param class-string $className
*/
public function testCreatedPartialMockObject(string $className, string ...$methodNames): void;

/**
* @param class-string $className
* @param list<mixed> $constructorArguments
*/
public function testCreatedTestProxy(string $className, array $constructorArguments): void;

/**
* @param class-string $className
*/
Expand Down

This file was deleted.

This file was deleted.

59 changes: 0 additions & 59 deletions src/Event/Events/Test/TestDouble/MockObjectForTraitCreated.php

This file was deleted.

Loading