You've already forked php-flasher
mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-04-05 12:32:55 +01:00
fix filters
This commit is contained in:
@@ -90,14 +90,18 @@ final class FilterBuilder
|
||||
$stampA = $a->get($field);
|
||||
$stampB = $b->get($field);
|
||||
|
||||
if (!$stampA instanceof OrderableStampInterface || !$stampB instanceof OrderableStampInterface) {
|
||||
if (!$stampA instanceof OrderableStampInterface) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!$stampB instanceof OrderableStampInterface) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return $stampA->compare($stampB);
|
||||
}
|
||||
|
||||
return -1;
|
||||
return 0;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ final class FilterBuilderTest extends TestCase
|
||||
$filtered = $builder->filter($envelopes);
|
||||
$expected = array_slice($envelopes, 0, 2);
|
||||
|
||||
$this->assertSame($expected, $filtered);
|
||||
$this->assertEquals($expected, $filtered);
|
||||
}
|
||||
|
||||
public function testOrderingByPriority()
|
||||
@@ -87,6 +87,6 @@ final class FilterBuilderTest extends TestCase
|
||||
$envelopes[4],
|
||||
);
|
||||
|
||||
$this->assertSame($expected, $filtered);
|
||||
$this->assertEquals($expected, $filtered);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user