8000 Remove calls to `getExpectedException()` by derrabus · Pull Request #58358 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Remove calls to getExpectedException() #58358

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

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public function testMissingTrailingSlash()

public function testExtraTrailingSlash()
{
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
$this->expectException(ResourceNotFoundException::class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while on it, can you please move them just before the throwing code-part?

Copy link
Member Author
8000

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do that in a follow-up.

$coll = new RouteCollection();
$coll->add('foo', new Route('/foo'));

Expand All @@ -406,7 +406,7 @@ public function testExtraTrailingSlash()

public function testMissingTrailingSlashForNonSafeMethod()
{
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
$this->expectException(ResourceNotFoundException::class);
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo/'));

Expand All @@ -418,7 +418,7 @@ public function testMissingTrailingSlashForNonSafeMethod()

public function testExtraTrailingSlashForNonSafeMethod()
{
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
$this->expectException(ResourceNotFoundException::class);
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo'));

Expand All @@ -430,7 +430,7 @@ public function testExtraTrailingSlashForNonSafeMethod()

public function testSchemeRequirement()
{
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
$this->expectException(ResourceNotFoundException::class);
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo', [], [], [], '', ['https']));
$matcher = $this->getUrlMatcher($coll);
Expand All @@ -439,7 +439,7 @@ public function testSchemeRequirement()

public function testSchemeRequirementForNonSafeMethod()
{
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
$this->expectException(ResourceNotFoundException::class);
$coll = new RouteCollection();
$coll->add('foo', new Route('/foo', [], [], [], '', ['https']));

Expand Down
6 changes: 2 additions & 4 deletions src/Symfony/Contracts/Service/Test/ServiceLocatorTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,8 @@ public function testThrowsOnUndefinedInternalService()
'foo' => function () use (&$locator) { return $locator->get('bar'); },
]);

if (!$this->getExpectedException()) {
$this->expectException(NotFoundExceptionInterface::class);
$this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');
}
$this->expectException(NotFoundExceptionInterface::class);
$this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.');

$locator->get('foo');
}
Expand Down
0