diff --git a/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php b/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php index 14325b5e8b..d86ed10bd6 100644 --- a/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php +++ b/core/tests/Drupal/KernelTests/Core/Common/SizeTest.php @@ -21,7 +21,7 @@ protected function setUp() { $this->exactTestCases = [ '0 bytes' => 0, '1 byte' => 1, - '-1 byte' => -1, + '-1 bytes' => -1, '1 KB' => $kb, '1 MB' => $kb * $kb, '1 GB' => $kb * $kb * $kb, @@ -52,11 +52,8 @@ protected function setUp() { public function testCommonFormatSize() { foreach ([$this->exactTestCases, $this->roundedTestCases] as $test_cases) { foreach ($test_cases as $expected => $input) { - $this->assertEqual( - ($result = format_size($input, NULL)), - $expected, - $expected . ' == ' . $result . ' (' . $input . ' bytes)' - ); + $result = format_size($input, NULL); + $this->assertSame($expected, $result, $expected . ' == ' . $result . ' (' . $input . ' bytes)'); } } } @@ -66,11 +63,8 @@ public function testCommonFormatSize() { */ public function testCommonParseSizeFormatSize() { foreach ($this->exactTestCases as $size) { - $this->assertEqual( - $size, - ($parsed_size = Bytes::toInt($string = format_size($size, NULL))), - $size . ' == ' . $parsed_size . ' (' . $string . ')' - ); + $parsed_size = Bytes::toInt($string = format_size($size, NULL)); + $this->assertSame($size, $parsed_size, $size . ' == ' . $parsed_size . ' (' . $string . ')'); } }