Skip to content

Commit e00bb82

Browse files
committed
Improve assertion error messages in ConstructTest.php
1 parent ff0332b commit e00bb82

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/Core/Files/FileList/ConstructTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,16 @@ public function testConstruct($files, $expectedFiles)
8282
ksort($fileListArray);
8383

8484
foreach ($fileListArray as $filePath => $fileObject) {
85-
$this->assertSame($expectedFiles[$i], $filePath, 'File path mismatch at index '.$i);
86-
$this->assertInstanceOf('PHP_CodeSniffer\Files\File', $fileObject, 'File object mismatch at index '.$i);
85+
$this->assertSame(
86+
$expectedFiles[$i],
87+
$filePath,
88+
sprintf('File path mismatch: expected "%s", got "%s"', $expectedFiles[$i], $filePath)
89+
);
90+
$this->assertInstanceOf(
91+
'PHP_CodeSniffer\Files\File',
92+
$fileObject,
93+
sprintf('File object for "%s" is not an instance of PHP_CodeSniffer\Files\File', $filePath)
94+
);
8795
$i++;
8896
}
8997

0 commit comments

Comments
 (0)