diff --git a/core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php b/core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php index 2ca0200..cc94c19 100644 --- a/core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php +++ b/core/tests/Drupal/KernelTests/Component/Utility/SafeMarkupKernelTest.php @@ -110,9 +110,9 @@ class SafeMarkupKernelTest extends KernelTestBase { */ public function testSafeMarkupUriWithExceptionUri($string, $uri) { // Should throw an \InvalidArgumentException, due to Uri::toString(). + $this->setExpectedException('\InvalidArgumentException'); // ALGO LAST (MANUAL CHIT) $args = self::getSafeMarkupUriArgs($uri); - $this->setExpectedException('\InvalidArgumentException'); // ALGO LAST SafeMarkup::format($string, $args); } diff --git a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php index 01b999d..9cf5616 100644 --- a/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php +++ b/core/tests/Drupal/Tests/Component/DependencyInjection/ContainerTest.php @@ -605,10 +605,10 @@ class ContainerTest extends \PHPUnit_Framework_TestCase { public function testResolveServicesAndParametersForInvalidArguments() { // In case the machine-optimized format is not used, we need to simulate the // test failure. + $this->setExpectedException('\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException'); // ALGO COVER (method) (MANUAL CHIT) if (!$this->machineFormat) { throw new InvalidArgumentException('Simulating the test failure.'); } - $this->setExpectedException('\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException'); // ALGO COVER (method) $this->container->get('invalid_arguments_service'); } diff --git a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php index 9309c68..d0aa578 100644 --- a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php @@ -128,8 +128,8 @@ class ArgumentsResolverTest extends UnitTestCase { $resolver = new ArgumentsResolver([], [], $wildcards); $callable = function($route) {}; + $this->setExpectedException('\RuntimeException', 'requires a value for the "$route" argument.'); // ALGO ASSERT (MANUAL CHIT) $arguments = $resolver->getArguments($callable); - $this->setExpectedException('\RuntimeException', 'requires a value for the "$route" argument.'); // ALGO ASSERT $this->assertNull($arguments); } diff --git a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php index 50cff27..a1bb8db 100644 --- a/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php +++ b/core/tests/Drupal/Tests/Core/EventSubscriber/RedirectResponseSubscriberTest.php @@ -124,9 +124,9 @@ class RedirectResponseSubscriberTest extends UnitTestCase { $listener = new RedirectResponseSubscriber($this->urlAssembler, $this->requestContext); $dispatcher->addListener(KernelEvents::RESPONSE, array($listener, 'checkRedirectUrl')); $event = new FilterResponseEvent($kernel, $request, HttpKernelInterface::SUB_REQUEST, $response); + $this->setExpectedException('\PHPUnit_Framework_Error'); // ALGO ASSERT (MANUAL CHIT) $dispatcher->dispatch(KernelEvents::RESPONSE, $event); - $this->setExpectedException('\PHPUnit_Framework_Error'); // ALGO ASSERT $this->assertEquals(400, $event->getResponse()->getStatusCode()); } diff --git a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php index 08d450c..37ff441 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormBuilderTest.php @@ -58,9 +58,9 @@ class FormBuilderTest extends FormTestBase { $clean_form_state = new FormState(); $form_state = new FormState(); + $this->setExpectedException('\InvalidArgumentException', 'The form argument foo is not a valid form.'); // ALGO ASSERT (MANUAL CHIT) $form_id = $this->formBuilder->getFormId($form_arg, $form_state); - $this->setExpectedException('\InvalidArgumentException', 'The form argument foo is not a valid form.'); // ALGO ASSERT $this->assertSame($form_arg, $form_id); $this->assertSame($clean_form_state, $form_state); } diff --git a/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php b/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php index 0c34c85..8016fcc 100644 --- a/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php @@ -96,11 +96,11 @@ class AccessAwareRouterTest extends UnitTestCase { ->method('checkRequest') ->with($request) ->willReturn($access_result); + $this->setExpectedException('\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException'); // ALGO ASSERT (MANUAL CHIT) $parameters = $this->router->matchRequest($request); $expected = [ AccessAwareRouterInterface::ACCESS_RESULT => $access_result, ]; - $this->setExpectedException('\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException'); // ALGO ASSERT $this->assertSame($expected, $request->attributes->all()); $this->assertSame($expected, $parameters); }