8000 Remove calls to getExpectedException() · symfony/symfony@c1b6da6 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit c1b6da6

Browse files
committed
Remove calls to getExpectedException()
1 parent b7ee056 commit c1b6da6

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/Symfony/Component/Routing/Tests/Matcher/UrlMatcherTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public function testMissingTrailingSlash()
396396

397397
public function testExtraTrailingSlash()
398398
{
399-
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
399+
$this->expectException(ResourceNotFoundException::class);
400400
$coll = new RouteCollection();
401401
$coll->add('foo', new Route('/foo'));
402402

@@ -406,7 +406,7 @@ public function testExtraTrailingSlash()
406406

407407
public function testMissingTrailingSlashForNonSafeMethod()
408408
{
409-
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
409+
$this->expectException(ResourceNotFoundException::class);
410410
$coll = new RouteCollection();
411411
$coll->add('foo', new Route('/foo/'));
412412

@@ -418,7 +418,7 @@ public function testMissingTrailingSlashForNonSafeMethod()
418418

419419
public function testExtraTrailingSlashForNonSafeMethod()
420420
{
421-
$this->getExpectedException() ?: $this->expectException(ResourceNotFoundException::class);
421+
$this->expectException(ResourceNotFoundException::class);
422422
$coll = new RouteCollection();
423423
$coll->add('foo', new Route('/foo'));
424424

@@ -430,7 +430,7 @@ public function testExtraTrailingSlashForNonSafeMethod()
430430

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

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

src/Symfony/Contracts/Service/Test/ServiceLocatorTestCase.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,8 @@ public function testThrowsOnUndefinedInternalService()
7575
'foo' => function () use (&$locator) { return $locator->get('bar'); },
7676
]);
7777

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

8381
$locator->get('foo');
8482
}

0 commit comments

Comments
 (0)
0