Skip to content

Commit

Permalink
Merge branch '8.5' into 9.6
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 27, 2023
2 parents 37dcc92 + 00300f1 commit 60e02df
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="^1.25" installed="1.29.0" location="./tools/phpab" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.41.1" location="./tools/php-cs-fixer" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.42.0" location="./tools/php-cs-fixer" copy="true"/>
<phar name="psalm" version="^5.0" installed="5.18.0" location="./tools/psalm" copy="true"/>
<phar name="humbug/php-scoper" version="^0.18" installed="0.18.10" location="./tools/php-scoper" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.6.6" location="./tools/composer" copy="true"/>
Expand Down
6 changes: 3 additions & 3 deletions src/Framework/MockObject/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ public function __clone()
*
* @param null|array $methods
*
* @throws \PHPUnit\Framework\InvalidArgumentException
* @throws ClassAlreadyExistsException
* @throws ClassIsFinalException
* @throws ClassIsReadonlyException
* @throws DuplicateMethodException
* @throws InvalidArgumentException
* @throws InvalidMethodNameException
* @throws OriginalConstructorInvocationRequiredException
* @throws ReflectionException
Expand Down Expand Up @@ -295,11 +295,11 @@ public function getMockForInterfaces(array $interfaces, bool $callAutoload = tru
*
* @psalm-return MockObject&RealInstanceType
*
* @throws \PHPUnit\Framework\InvalidArgumentException
* @throws ClassAlreadyExistsException
* @throws ClassIsFinalException
* @throws ClassIsReadonlyException
* @throws DuplicateMethodException
* @throws InvalidArgumentException
* @throws InvalidMethodNameException
* @throws OriginalConstructorInvocationRequiredException
* @throws ReflectionException
Expand Down Expand Up @@ -357,11 +357,11 @@ interface_exists($originalClassName, $callAutoload)) {
*
* @psalm-param trait-string $traitName
*
* @throws \PHPUnit\Framework\InvalidArgumentException
* @throws ClassAlreadyExistsException
* @throws ClassIsFinalException
* @throws ClassIsReadonlyException
* @throws DuplicateMethodException
* @throws InvalidArgumentException
* @throws InvalidMethodNameException
* @throws OriginalConstructorInvocationRequiredException
* @throws ReflectionException
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/MockObject/Rule/ConsecutiveParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public function apply(BaseInvocation $invocation): void
}

/**
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws ExpectationFailedException
*/
public function verify(): void
{
Expand Down
6 changes: 3 additions & 3 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ abstract class TestCase extends Assert implements Reorderable, SelfDescribing, T
private $snapshot;

/**
* @var \Prophecy\Prophet
* @var Prophet

Check failure on line 316 in src/Framework/TestCase.php

View workflow job for this annotation

GitHub Actions / Type Checker

UndefinedDocblockClass

src/Framework/TestCase.php:316:13: UndefinedDocblockClass: Docblock-defined class, interface or enum named Prophecy\Prophet does not exist (see https://psalm.dev/200)
*/
private $prophet;

Expand Down Expand Up @@ -2185,8 +2185,8 @@ private function handleDependencies(): bool
}

if (isset($passed[$dependencyTarget])) {
if ($passed[$dependencyTarget]['size'] != \PHPUnit\Util\Test::UNKNOWN &&
$this->getSize() != \PHPUnit\Util\Test::UNKNOWN &&
if ($passed[$dependencyTarget]['size'] != TestUtil::UNKNOWN &&
$this->getSize() != TestUtil::UNKNOWN &&
$passed[$dependencyTarget]['size'] > $this->getSize()) {
$this->result->addError(
$this,
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,10 @@ public function setGroupDetails(array $groups): void
/**
* Runs the tests and collects their result in a TestResult.
*
* @throws \PHPUnit\Framework\CodeCoverageException
* @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
* @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws CodeCoverageException
* @throws Warning
*/
public function run(TestResult $result = null): TestResult
Expand Down
2 changes: 1 addition & 1 deletion src/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int

/**
* @throws \PHPUnit\Framework\Exception
* @throws \PHPUnit\TextUI\XmlConfiguration\Exception
* @throws XmlConfiguration\Exception
*/
private function handleListSuites(bool $exit): int
{
Expand Down
4 changes: 2 additions & 2 deletions src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ public function __construct(TestSuiteLoader $loader = null, CodeCoverageFilter $

/**
* @throws \PHPUnit\Runner\Exception
* @throws \PHPUnit\TextUI\XmlConfiguration\Exception
* @throws Exception
* @throws XmlConfiguration\Exception
*/
public function run(TestSuite $suite, array $arguments = [], array $warnings = [], bool $exit = true): TestResult
{
Expand Down Expand Up @@ -864,8 +864,8 @@ private function write(string $buffer): void
}

/**
* @throws \PHPUnit\TextUI\XmlConfiguration\Exception
* @throws Exception
* @throws XmlConfiguration\Exception
*/
private function handleConfiguration(array &$arguments): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ final class Json
/**
* Prettify json string.
*
* @throws \PHPUnit\Framework\Exception
* @throws Exception
*/
public static function prettify(string $json): string
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/TestDox/XmlResultPrinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static function ($group)
$testNode->appendChild($testDoubleNode);
}

$inlineAnnotations = \PHPUnit\Util\Test::getInlineAnnotations(get_class($test), $test->getName(false));
$inlineAnnotations = TestUtil::getInlineAnnotations(get_class($test), $test->getName(false));

if (isset($inlineAnnotations['given'], $inlineAnnotations['when'], $inlineAnnotations['then'])) {
$testNode->setAttribute('given', $inlineAnnotations['given']['value']);
Expand Down
8 changes: 4 additions & 4 deletions tests/end-to-end/regression/2137/Issue2137Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class Issue2137Test extends PHPUnit\Framework\TestCase
/**
* @dataProvider provideBrandService
*
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
* @throws PHPUnit\Framework\ExpectationFailedException
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
*/
public function testBrandService($provided, $expected): void
{
Expand All @@ -32,9 +32,9 @@ public function provideBrandService()
/**
* @dataProvider provideBrandService
*
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
* @throws PHPUnit\Framework\ExpectationFailedException
* @throws SebastianBergmann\RecursionContext\InvalidArgumentException
*/
public function testSomethingElseInvalid($provided, $expected): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Framework/Constraint/IsJsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public static function evaluateDataprovider(): array
*
* @dataProvider evaluateDataprovider
*
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws ExpectationFailedException
*/
public function testEvaluate($expected, $jsonOther): void
{
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/Framework/MockObject/MockObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ public function testInvokingStubbedStaticMethodRaisesException(): void
{
$mock = $this->getMockBuilder(ClassWithStaticMethod::class)->getMock();

$this->expectException(\PHPUnit\Framework\MockObject\BadMethodCallException::class);
$this->expectException(BadMethodCallException::class);

$mock->staticMethod();
}
Expand Down Expand Up @@ -1056,15 +1056,15 @@ public function testGetMockForClassWithSelfTypeHint(): void

public function testStringableClassDoesNotThrow(): void
{
/** @var PHPUnit\Framework\MockObject\MockObject|StringableClass $mock */
/** @var MockObject|StringableClass $mock */
$mock = $this->getMockBuilder(StringableClass::class)->getMock();

$this->assertIsString((string) $mock);
}

public function testStringableClassCanBeMocked(): void
{
/** @var PHPUnit\Framework\MockObject\MockObject|StringableClass $mock */
/** @var MockObject|StringableClass $mock */
$mock = $this->getMockBuilder(StringableClass::class)->getMock();

$mock->method('__toString')->willReturn('foo');
Expand Down Expand Up @@ -1128,7 +1128,7 @@ public function testDisableAutomaticReturnValueGeneration(): void

public function testDisableAutomaticReturnValueGenerationWithToString(): void
{
/** @var \PHPUnit\Framework\MockObject\MockObject|StringableClass $mock */
/** @var MockObject|StringableClass $mock */
$mock = $this->getMockBuilder(StringableClass::class)
->disableAutoReturnValueGeneration()
->getMock();
Expand Down Expand Up @@ -1294,7 +1294,7 @@ public function testReturnValueCannotBeAutomaticallyGeneratedForMethodThatReturn
{
$stub = $this->createStub(InterfaceWithMethodReturningIntersection::class);

$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$stub->method();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Util/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public function canonicalizeProvider(): array
*
* @dataProvider prettifyProvider
*
* @throws \PHPUnit\Framework\Exception
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws Exception
*/
public function testPrettify($actual, $expected): void
{
Expand Down
Binary file modified tools/php-cs-fixer
Binary file not shown.

0 comments on commit 60e02df

Please sign in to comment.