Skip to content

Commit 9d6cd57

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 ce13008 + 28d6dfa commit 9d6cd57

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Tests/ParameterBagTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function testFilter()
253253
'array' => ['bang'],
254254
]);
255255

256-
$this->assertEmpty($bag->filter('nokey'), '->filter() should return empty by default if no key is found');
256+
$this->assertSame('', $bag->filter('nokey'), '->filter() should return empty by default if no key is found');
257257

258258
$this->assertEquals('0123', $bag->filter('digits', '', \FILTER_SANITIZE_NUMBER_INT), '->filter() gets a value of parameter as integer filtering out invalid characters');
259259

Tests/ResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public function testSetNotModified()
127127
ob_start();
128128
$modified->sendContent();
129129
$string = ob_get_clean();
130-
$this->assertEmpty($string);
130+
$this->assertSame('', $string);
131131
}
132132

133133
public function testIsSuccessful()

Tests/Session/Storage/Handler/PdoSessionHandlerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ public function testConfigureSchemaTableExistsPdo()
352352
$pdoSessionHandler = new PdoSessionHandler($this->getMemorySqlitePdo());
353353
$pdoSessionHandler->configureSchema($schema, fn () => true);
354354
$table = $schema->getTable('sessions');
355-
$this->assertEmpty($table->getColumns(), 'The table was not overwritten');
355+
$this->assertSame([], $table->getColumns(), 'The table was not overwritten');
356356
}
357357

358358
public static function provideUrlDsnPairs()

Tests/StreamedResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public function testSetNotModified()
133133
ob_start();
134134
$modified->sendContent();
135135
$string = ob_get_clean();
136-
$this->assertEmpty($string);
136+
$this->assertSame('', $string);
137137
}
138138

139139
public function testSendInformationalResponse()

0 commit comments

Comments
 (0)