fix filters

This commit is contained in:
Khoubza Younes
2020-12-13 13:49:01 +01:00
parent 11279d9c47
commit a9f3e94d2b
2 changed files with 8 additions and 4 deletions
+6 -2
View File
@@ -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;
});
}
+2 -2
View File
@@ -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);
}
}