Skip to content

Commit

Permalink
Fix CS/WS issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 27, 2023
1 parent f3f258a commit 00300f1
Show file tree
Hide file tree
Showing 13 changed files with 176 additions and 176 deletions.
292 changes: 146 additions & 146 deletions src/Framework/Assert/Functions.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Framework/MockObject/InvocationHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public function matches(Invocation $invocation): bool
}

/**
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws ExpectationFailedException
*/
public function verify(): void
{
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 @@ -78,8 +78,8 @@ public function apply(BaseInvocation $invocation): void
}

/**
* @throws \PHPUnit\Framework\ExpectationFailedException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws ExpectationFailedException
*/
public function verify(): void
{
Expand Down
2 changes: 1 addition & 1 deletion src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ abstract class TestCase extends Assert implements SelfDescribing, Test
private $snapshot;

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

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

View workflow job for this annotation

GitHub Actions / Type Checker

UndefinedDocblockClass

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

Expand Down
2 changes: 1 addition & 1 deletion src/Framework/TestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,13 @@ public function setGroupDetails(array $groups): void
/**
* Runs the tests and collects their result in a TestResult.
*
* @throws \PHPUnit\Framework\CodeCoverageException
* @throws \SebastianBergmann\CodeCoverage\CoveredCodeNotExecutedException
* @throws \SebastianBergmann\CodeCoverage\InvalidArgumentException
* @throws \SebastianBergmann\CodeCoverage\MissingCoversAnnotationException
* @throws \SebastianBergmann\CodeCoverage\RuntimeException
* @throws \SebastianBergmann\CodeCoverage\UnintentionallyCoveredCodeException
* @throws \SebastianBergmann\RecursionContext\InvalidArgumentException
* @throws CodeCoverageException
* @throws Warning
*/
public function run(TestResult $result = null): TestResult
Expand Down
4 changes: 2 additions & 2 deletions src/TextUI/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Command
private $versionStringPrinted = false;

/**
* @throws \PHPUnit\Framework\Exception
* @throws Exception
*/
public static function main(bool $exit = true): int
{
Expand Down Expand Up @@ -1265,7 +1265,7 @@ private function handleListGroups(TestSuite $suite, bool $exit): int
}

/**
* @throws \PHPUnit\Framework\Exception
* @throws Exception
*/
private function handleListSuites(bool $exit): int
{
Expand Down
2 changes: 1 addition & 1 deletion src/Util/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ private function getConfigurationArguments(DOMNodeList $nodes): array
}

/**
* @throws \PHPUnit\Framework\Exception
* @throws Exception
*/
private function getTestSuite(DOMElement $testSuiteNode, string $testSuiteFilter = ''): TestSuite
{
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
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
24 changes: 12 additions & 12 deletions tests/unit/Framework/MockObject/GeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function setUp(): void

public function testGetMockThrowsExceptionWhenInvalidFunctionNameIsPassedInAsAFunctionToMock(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->generator->getMock(stdClass::class, [0]);
}
Expand All @@ -77,7 +77,7 @@ public function testGetMockThrowsExceptionWithInvalidMethods(): void

public function testGetMockThrowsExceptionWithNonExistingClass(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->assertFalse(class_exists('Tux'));

Expand All @@ -86,7 +86,7 @@ public function testGetMockThrowsExceptionWithNonExistingClass(): void

public function testGetMockThrowsExceptionWithNonExistingClasses(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->assertFalse(class_exists('Tux'));

Expand All @@ -95,7 +95,7 @@ public function testGetMockThrowsExceptionWithNonExistingClasses(): void

public function testGetMockThrowsExceptionWithExistingClassAsMockName(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->generator->getMock(stdClass::class, [], [], RuntimeException::class);
}
Expand All @@ -109,7 +109,7 @@ public function testGetMockCanCreateNonExistingFunctions(): void

public function testGetMockGeneratorThrowsException(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);
$this->expectExceptionMessage('duplicates: "foo, bar, foo" (duplicate: "foo")');

$this->generator->getMock(stdClass::class, ['foo', 'bar', 'foo']);
Expand Down Expand Up @@ -167,7 +167,7 @@ public function testGetMockForAbstractClassShouldCreateStubsOnlyForAbstractMetho

public function testGetMockForAbstractClassAbstractClassDoesNotExist(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->generator->getMockForAbstractClass('Tux');
}
Expand Down Expand Up @@ -199,21 +199,21 @@ public function testGetMockForTraitStubbingAbstractMethod(): void

public function testGetMockForTraitWithNonExistantTrait(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$mock = $this->generator->getMockForTrait('Tux');
}

public function testGetObjectForTraitWithNonExistantTrait(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$mock = $this->generator->getObjectForTrait('Tux');
}

public function testGetMockClassMethodsForNonExistantClass(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$mock = $this->generator->mockClassMethods('Tux', true, true);
}
Expand All @@ -227,7 +227,7 @@ public function testGetMockForSingletonWithReflectionSuccess(): void

public function testExceptionIsRaisedForMutuallyExclusiveOptions(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->generator->getMock(stdClass::class, [], [], '', false, true, true, true, true);
}
Expand Down Expand Up @@ -319,14 +319,14 @@ public function testVariadicArgumentsArePassedToMockedMethod(): void

public function testGetClassMethodsWithNonExistingClass(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$this->generator->getClassMethods('Tux');
}

public function testCannotMockFinalClass(): void
{
$this->expectException(\PHPUnit\Framework\MockObject\RuntimeException::class);
$this->expectException(RuntimeException::class);

$mock = $this->createMock(FinalClass::class);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/Framework/MockObject/MockObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,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 @@ -1065,15 +1065,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 @@ -1137,7 +1137,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
2 changes: 1 addition & 1 deletion tests/unit/Util/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,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

0 comments on commit 00300f1

Please sign in to comment.