diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php index f195da6..bbddbdd 100644 --- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php +++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php @@ -287,7 +287,7 @@ public function testDenormalizeWithInvalidBundle() { ->will($this->returnValue($entity_type_storage)); $this->setExpectedException(UnexpectedValueException::class); - $this->assertNotNull($this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test'])); + $this->entityNormalizer->denormalize($test_data, 'Drupal\Core\Entity\ContentEntityBase', NULL, ['entity_type' => 'test']); } /** diff --git a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php index 04268d2..b0f58c9 100644 --- a/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php +++ b/core/tests/Drupal/Tests/Component/Plugin/Discovery/DiscoveryTraitTest.php @@ -70,10 +70,7 @@ public function testDoGetDefinitionException($expected, $definitions, $plugin_id $method_ref->setAccessible(TRUE); // Call doGetDefinition, with $exception_on_invalid always TRUE. $this->setExpectedException(PluginNotFoundException::class); - $this->assertSame( - $expected, - $method_ref->invoke($trait, $definitions, $plugin_id, TRUE) - ); + $method_ref->invoke($trait, $definitions, $plugin_id, TRUE); } /** @@ -110,10 +107,7 @@ public function testGetDefinitionException($expected, $definitions, $plugin_id) ->willReturn($definitions); // Call getDefinition(), with $exception_on_invalid always TRUE. $this->setExpectedException(PluginNotFoundException::class); - $this->assertSame( - $expected, - $trait->getDefinition($plugin_id, TRUE) - ); + $trait->getDefinition($plugin_id, TRUE); } /** diff --git a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php index 4dbc8a7..1710609 100644 --- a/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/ArgumentsResolverTest.php @@ -129,8 +129,7 @@ public function testGetWildcardArgumentNoTypehint() { $callable = function($route) {}; $this->setExpectedException(\RuntimeException::class, 'requires a value for the "$route" argument.'); - $arguments = $resolver->getArguments($callable); - $this->assertNull($arguments); + $resolver->getArguments($callable); } /** @@ -158,8 +157,7 @@ public function testHandleNotUpcastedArgument() { $callable = function(\stdClass $foo) {}; $this->setExpectedException(\RuntimeException::class, 'requires a value for the "$foo" argument.'); - $arguments = $resolver->getArguments($callable); - $this->assertNull($arguments); + $resolver->getArguments($callable); } /** @@ -170,8 +168,7 @@ public function testHandleNotUpcastedArgument() { public function testHandleUnresolvedArgument($callable) { $resolver = new ArgumentsResolver([], [], []); $this->setExpectedException(\RuntimeException::class, 'requires a value for the "$foo" argument.'); - $arguments = $resolver->getArguments($callable); - $this->assertNull($arguments); + $resolver->getArguments($callable); } /** diff --git a/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php b/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php index 3a7b3c1..341ed9c 100644 --- a/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/BaseFieldDefinitionTest.php @@ -318,9 +318,7 @@ public function testInvalidDefaultValueCallback() { $definition = BaseFieldDefinition::create($this->fieldType); // setDefaultValueCallback returns $this. $this->setExpectedException(\InvalidArgumentException::class); - $this->assertSame($definition, - $definition->setDefaultValueCallback([get_class($this), 'mockDefaultValueCallback']) - ); + $definition->setDefaultValueCallback([get_class($this), 'mockDefaultValueCallback']); } /** diff --git a/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php b/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php index ce627359..177504c 100644 --- a/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php +++ b/core/tests/Drupal/Tests/Core/Form/FormAjaxResponseBuilderTest.php @@ -56,7 +56,7 @@ public function testBuildResponseNoTriggeringElement() { $expected = []; $this->setExpectedException(HttpException::class); - $this->assertSame($expected, $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands)); + $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands); } /** @@ -75,7 +75,7 @@ public function testBuildResponseNoCallable() { $expected = []; $this->setExpectedException(HttpException::class); - $this->assertSame($expected, $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands)); + $this->formAjaxResponseBuilder->buildResponse($request, $form, $form_state, $commands); } /** diff --git a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php index 902d646..8de3a5c 100644 --- a/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php +++ b/core/tests/Drupal/Tests/Core/PageCache/ChainResponsePolicyTest.php @@ -85,8 +85,7 @@ public function testChainExceptionOnInvalidReturnValue($return_value) { $this->policy->addPolicy($rule); $this->setExpectedException(\UnexpectedValueException::class); - $actual_result = $this->policy->check($this->response, $this->request); - $this->assertSame(NULL, $actual_result); + $this->policy->check($this->response, $this->request); } /** diff --git a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php index 58f61d1..6eda2e3 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/Context/ContextDefinitionTest.php @@ -155,10 +155,7 @@ public function testGetDataDefinitionInvalidType($is_multiple) { ->willReturn($data_type); $this->setExpectedException(\Exception::class); - $this->assertSame( - $mock_data_definition, - $mock_context_definition->getDataDefinition() - ); + $mock_context_definition->getDataDefinition(); } /** diff --git a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php index 7afd0bb..680e2fd 100644 --- a/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php +++ b/core/tests/Drupal/Tests/Core/UnroutedUrlTest.php @@ -143,7 +143,7 @@ public function testCreateFromRequest() { ->will($this->throwException(new ResourceNotFoundException())); $this->setExpectedException(ResourceNotFoundException::class); - $this->assertNull(Url::createFromRequest($request)); + Url::createFromRequest($request); } /** @@ -211,7 +211,7 @@ public function testGetRouteParameters($uri) { public function testGetInternalPath($uri) { $url = Url::fromUri($uri); $this->setExpectedException(\Exception::class); - $this->assertNull($url->getInternalPath()); + $url->getInternalPath(); } /** diff --git a/core/tests/Drupal/Tests/Core/UrlTest.php b/core/tests/Drupal/Tests/Core/UrlTest.php index d60a58c..b2e0976 100644 --- a/core/tests/Drupal/Tests/Core/UrlTest.php +++ b/core/tests/Drupal/Tests/Core/UrlTest.php @@ -290,7 +290,7 @@ public function testUrlFromRequestInvalid() { ->will($this->throwException(new ResourceNotFoundException())); $this->setExpectedException(ResourceNotFoundException::class); - $this->assertNull(Url::createFromRequest($request)); + Url::createFromRequest($request); } /**