Skip to content

Commit 00521a7

Browse files
Use stricter comparison
1 parent 6179de3 commit 00521a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Runner/PHPT/PhptTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ private function shouldTestBeSkipped(array $sections, array $settings): bool
441441
$output = $this->runCodeInLocalSandbox($skipIfCode);
442442
}
443443

444-
if (!strncasecmp('skip', ltrim($output), 4)) {
444+
if (strncasecmp('skip', ltrim($output), 4) === 0) {
445445
$message = '';
446446

447447
if (preg_match('/^\s*skip\s*(.+)\s*/i', $output, $skipMatch)) {

src/Runner/TestSuiteSorter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,12 @@ private function cmpDefectPriorityAndTime(Test $a, Test $b): int
264264
$priorityA = $this->defectSortOrder[$a->sortId()] ?? 0;
265265
$priorityB = $this->defectSortOrder[$b->sortId()] ?? 0;
266266

267-
if ($priorityB <=> $priorityA) {
267+
if (($priorityB <=> $priorityA) > 0) {
268268
// Sort defect weight descending
269269
return $priorityB <=> $priorityA;
270270
}
271271

272-
if ($priorityA || $priorityB) {
272+
if ($priorityA > 0 || $priorityB > 0) {
273273
return $this->cmpDuration($a, $b);
274274
}
275275

0 commit comments

Comments
 (0)