From: "Alexander M. Turek" <me@derrabus.de>
Date: Mon, 23 Sep 2024 12:42:15 +0200
Subject: Remove calls to getExpectedException()

Origin: upstream, https://github.com/symfony/symfony/commit/c1b6da6947b14422320ee5128a643ae26e6cc916
---
 Service/Test/ServiceLocatorTestCase.php | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/Service/Test/ServiceLocatorTestCase.php b/Service/Test/ServiceLocatorTestCase.php
index 65a3fe3..00f8602 100644
--- a/Service/Test/ServiceLocatorTestCase.php
+++ b/Service/Test/ServiceLocatorTestCase.php
@@ -72,9 +72,8 @@ abstract class ServiceLocatorTestCase extends TestCase
             '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');
