Skip to content

Commit

Permalink
Merge branch 'main' into data-provider-named-arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
jnoordsij committed Jul 7, 2023
2 parents 7132f53 + f85cc67 commit 4f4fb45
Show file tree
Hide file tree
Showing 296 changed files with 5,196 additions and 5,689 deletions.
8 changes: 4 additions & 4 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="^1.25" installed="1.27.2" location="./tools/phpab" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.17.0" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.0" installed="5.12.0" location="./tools/psalm" copy="true"/>
<phar name="phpab" version="^1.25" installed="1.28.0" location="./tools/phpab" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.21.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.0" installed="5.13.1" location="./tools/psalm" copy="true"/>
<phar name="humbug/php-scoper" version="^0.18.1" installed="0.18.3" location="./tools/php-scoper" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.5.7" location="./tools/composer" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.5.8" location="./tools/composer" copy="true"/>
</phive>
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
->in(__DIR__ . '/tests/end-to-end')
->in(__DIR__ . '/tests/unit')
->notName('DeprecatedPhpFeatureTest.php')
->notName('InterfaceWithMethodReturningDisjunctiveNormalFormType.php')
->notName('ReadonlyClass.php')
->notName('*.phpt');

Expand Down
100 changes: 55 additions & 45 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.12.0@f90118cdeacd0088e7215e64c0c99ceca819e176">
<files psalm-version="5.13.0@a0a9c27630bcf8301ee78cb06741d2907d8c9fef">
<file src="src/Event/Dispatcher/DirectDispatcher.php">
<UndefinedInterfaceMethod>
<code>notify</code>
Expand Down Expand Up @@ -169,12 +169,7 @@
<code><![CDATA[list<ExecutionOrderDependency>]]></code>
</MoreSpecificReturnType>
</file>
<file src="src/Framework/MockObject/Builder/InvocationMocker.php">
<PropertyTypeCoercion>
<code>$configurableMethods</code>
</PropertyTypeCoercion>
</file>
<file src="src/Framework/MockObject/Generator.php">
<file src="src/Framework/MockObject/Generator/Generator.php">
<ArgumentTypeCoercion>
<code>$className</code>
<code>$className</code>
Expand All @@ -195,19 +190,25 @@
<code><![CDATA[$client->__getFunctions()]]></code>
</PossiblyNullArgument>
</file>
<file src="src/Framework/MockObject/Invocation.php">
<ArgumentTypeCoercion>
<code><![CDATA[$this->returnType]]></code>
<code>$types</code>
</ArgumentTypeCoercion>
</file>
<file src="src/Framework/MockObject/Matcher.php">
<InvalidNullableReturnType>
<code>MethodName</code>
</InvalidNullableReturnType>
<NullableReturnStatement>
<code><![CDATA[$this->methodNameRule]]></code>
</NullableReturnStatement>
<file src="src/Framework/MockObject/Generator/MockMethod.php">
<InvalidArgument>
<code><![CDATA[[
'arguments_decl' => $this->argumentsForDeclaration,
'arguments_call' => $this->argumentsForCall,
'return_declaration' => !empty($this->returnType->asString()) ? (': ' . $this->returnType->asString()) : '',
'return_type' => $this->returnType->asString(),
'arguments_count' => !empty($this->argumentsForCall) ? substr_count($this->argumentsForCall, ',') + 1 : 0,
'class_name' => $this->className,
'method_name' => $this->methodName,
'modifier' => $this->modifier,
'reference' => $this->reference,
'clone_arguments' => $this->cloneArguments ? 'true' : 'false',
'deprecation' => $deprecation,
]]]></code>
</InvalidArgument>
<PossiblyFalseOperand>
<code><![CDATA[strpos($parameterAsString, '<optional> ')]]></code>
</PossiblyFalseOperand>
</file>
<file src="src/Framework/MockObject/MockBuilder.php">
<ArgumentTypeCoercion>
Expand All @@ -228,36 +229,36 @@
<code><![CDATA[MockObject&MockedType]]></code>
</InvalidReturnType>
</file>
<file src="src/Framework/MockObject/MockMethod.php">
<InvalidArgument>
<code><![CDATA[[
'arguments_decl' => $this->argumentsForDeclaration,
'arguments_call' => $this->argumentsForCall,
'return_declaration' => !empty($this->returnType->asString()) ? (': ' . $this->returnType->asString()) : '',
'return_type' => $this->returnType->asString(),
'arguments_count' => !empty($this->argumentsForCall) ? substr_count($this->argumentsForCall, ',') + 1 : 0,
'class_name' => $this->className,
'method_name' => $this->methodName,
'modifier' => $this->modifier,
'reference' => $this->reference,
'clone_arguments' => $this->cloneArguments ? 'true' : 'false',
'deprecation' => $deprecation,
]]]></code>
</InvalidArgument>
<PossiblyFalseOperand>
<code><![CDATA[strpos($parameterAsString, '<optional> ')]]></code>
</PossiblyFalseOperand>
<file src="src/Framework/MockObject/Runtime/Builder/InvocationMocker.php">
<PropertyTypeCoercion>
<code>$configurableMethods</code>
</PropertyTypeCoercion>
</file>
<file src="src/Framework/MockObject/Runtime/Matcher.php">
<InvalidNullableReturnType>
<code>MethodName</code>
</InvalidNullableReturnType>
<NullableReturnStatement>
<code><![CDATA[$this->methodNameRule]]></code>
</NullableReturnStatement>
</file>
<file src="src/Framework/MockObject/Rule/Parameters.php">
<file src="src/Framework/MockObject/Runtime/ReturnValueGenerator.php">
<ArgumentTypeCoercion>
<code>$returnType</code>
<code>$types</code>
</ArgumentTypeCoercion>
<LessSpecificReturnStatement>
<code><![CDATA[(new ReflectionClass($stubClassName))->newInstanceWithoutConstructor()]]></code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code>MockObject</code>
</MoreSpecificReturnType>
</file>
<file src="src/Framework/MockObject/Runtime/Rule/Parameters.php">
<PropertyNotSetInConstructor>
<code>$parameterVerificationResult</code>
</PropertyNotSetInConstructor>
</file>
<file src="src/Framework/MockObject/Stub/ReturnCallback.php">
<PossiblyInvalidOperand>
<code><![CDATA[$this->callback]]></code>
</PossiblyInvalidOperand>
</file>
<file src="src/Framework/TestCase.php">
<ArgumentTypeCoercion>
<code>$mockClassName</code>
Expand Down Expand Up @@ -607,6 +608,10 @@
</ArgumentTypeCoercion>
</file>
<file src="src/TextUI/Configuration/Cli/Configuration.php">
<DeprecatedMethod>
<code>hasCacheResultFile</code>
<code>hasCoverageCacheDirectory</code>
</DeprecatedMethod>
<InvalidNullableReturnType>
<code>bool</code>
<code>string</code>
Expand Down Expand Up @@ -640,8 +645,13 @@
<DeprecatedMethod>
<code>cacheDirectory</code>
<code>cacheResultFile</code>
<code>cacheResultFile</code>
<code>coverageCacheDirectory</code>
<code>coverageCacheDirectory</code>
<code>hasCacheDirectory</code>
<code>hasCacheResultFile</code>
<code>hasCacheResultFile</code>
<code>hasCoverageCacheDirectory</code>
</DeprecatedMethod>
<MissingThrowsDocblock>
<code>detect</code>
Expand Down
10 changes: 10 additions & 0 deletions ChangeLog-10.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,14 @@ All notable changes of the PHPUnit 10.3 release series are documented in this fi

## [10.3.0] - 2023-08-04

### Added

* [#5428](https://github.com/sebastianbergmann/phpunit/issues/5428): Attribute `#[WithoutErrorHandler]` to disable PHPUnit's error handler for a test method

### Changed

* When a test case class inherits test methods from a parent class then, by default (when no test reordering is requested), the test methods from the class that is highest in the inheritance tree (instead of the class that is lowest in the inheritance tree) are now run first
* Invocation count expectation failure messages have been slightly improved
* When a test case class inherits test methods from a parent class then the TestDox output for such a test case class now starts with test methods from the class that is highest in the inheritance tree (instead of the class that is lowest in the inheritance tree)

[10.3.0]: https://github.com/sebastianbergmann/phpunit/compare/10.2...main
5 changes: 1 addition & 4 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,14 @@

<source>
<include>
<directory suffix=".php">src</directory>
<directory>src</directory>
</include>

<exclude>
<file>src/Framework/Assert/Functions.php</file>
</exclude>
</source>

<coverage ignoreDeprecatedCodeUnits="true">
</coverage>

<php>
<ini name="precision" value="14"/>
<ini name="serialize_precision" value="14"/>
Expand Down
2 changes: 1 addition & 1 deletion phpunit.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
</xs:complexType>
<xs:complexType name="extensionsType">
<xs:sequence>
<xs:element name="bootstrap" type="bootstrapType" maxOccurs="unbounded"/>
<xs:element name="bootstrap" type="bootstrapType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="bootstrapType">
Expand Down
3 changes: 2 additions & 1 deletion src/Event/Events/Test/Outcome/Errored.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use const PHP_EOL;
use function sprintf;
use function trim;
use PHPUnit\Event\Code;
use PHPUnit\Event\Code\Throwable;
use PHPUnit\Event\Event;
Expand Down Expand Up @@ -51,7 +52,7 @@ public function throwable(): Throwable

public function asString(): string
{
$message = $this->throwable->message();
$message = trim($this->throwable->message());

if (!empty($message)) {
$message = PHP_EOL . $message;
Expand Down
3 changes: 2 additions & 1 deletion src/Event/Events/Test/Outcome/Failed.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use const PHP_EOL;
use function sprintf;
use function trim;
use PHPUnit\Event\Code;
use PHPUnit\Event\Code\ComparisonFailure;
use PHPUnit\Event\Code\Throwable;
Expand Down Expand Up @@ -74,7 +75,7 @@ public function comparisonFailure(): ComparisonFailure

public function asString(): string
{
$message = $this->throwable->message();
$message = trim($this->throwable->message());

if (!empty($message)) {
$message = PHP_EOL . $message;
Expand Down
3 changes: 2 additions & 1 deletion src/Event/Events/Test/Outcome/MarkedIncomplete.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use const PHP_EOL;
use function sprintf;
use function trim;
use PHPUnit\Event\Code;
use PHPUnit\Event\Code\Throwable;
use PHPUnit\Event\Event;
Expand Down Expand Up @@ -51,7 +52,7 @@ public function throwable(): Throwable

public function asString(): string
{
$message = $this->throwable->message();
$message = trim($this->throwable->message());

if (!empty($message)) {
$message = PHP_EOL . $message;
Expand Down

0 comments on commit 4f4fb45

Please sign in to comment.