Skip to content

Commit 4e35233

Browse files
committed
minor #59898 replace assertEmpty() with stricter assertions (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- replace `assertEmpty()` with stricter assertions | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT In the code we are strict about not using `empty()`. In my opinion it makes sense to be equally strict with our assertions. But I'd like to gather some feedback first before updating all places. Commits ------- 6550cb815e3 replace assertEmpty() with stricter assertions
2 parents a4b66fb + 5121dfd commit 4e35233

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Tests/DependencyInjection/FrameworkExtensionTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ public function testMessengerServicesRemovedWhenDisabled()
796796
\ARRAY_FILTER_USE_KEY
797797
);
798798

799-
$this->assertEmpty($messengerDefinitions);
799+
$this->assertSame([], $messengerDefinitions);
800800
$this->assertFalse($container->hasDefinition('console.command.messenger_consume_messages'));
801801
$this->assertFalse($container->hasDefinition('console.command.messenger_debug'));
802802
$this->assertFalse($container->hasDefinition('console.command.messenger_stop_workers'));
@@ -1941,7 +1941,7 @@ public function testRemovesResourceCheckerConfigCacheFactoryArgumentOnlyIfNoDebu
19411941

19421942
$container = $this->createContainer(['kernel.debug' => false]);
19431943
(new FrameworkExtension())->load([['annotations' => false, 'http_method_override' => false, 'handle_all_throwables' => true, 'php_errors' => ['log' => true]]], $container);
1944-
$this->assertEmpty($container->getDefinition('config_cache_factory')->getArguments());
1944+
$this->assertSame([], $container->getDefinition('config_cache_factory')->getArguments());
19451945
}
19461946

19471947
public function testLoggerAwareRegistration()

Tests/Functional/ApiAttributesTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function testMapQueryString(string $uri, array $query, string $expectedRe
3434
if ($expectedResponse) {
3535
self::assertJsonStringEqualsJsonString($expectedResponse, $response->getContent());
3636
} else {
37-
self::assertEmpty($response->getContent());
37+
self::assertSame('', $response->getContent());
3838
}
3939
self::assertSame($expectedStatusCode, $response->getStatusCode());
4040
}

0 commit comments

Comments
 (0)