mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: Test test to validate that multiple GreaterThan filters in a filterAny work.
Confirms https://github.com/silverstripe/silverstripe-framework/issues/3995 isn’t a bug.
This commit is contained in:
parent
afb3c825c9
commit
4f4153c834
@ -11,6 +11,7 @@ use SilverStripe\ORM\DB;
|
|||||||
use SilverStripe\ORM\Filterable;
|
use SilverStripe\ORM\Filterable;
|
||||||
use SilverStripe\ORM\Filters\ExactMatchFilter;
|
use SilverStripe\ORM\Filters\ExactMatchFilter;
|
||||||
use SilverStripe\Dev\SapphireTest;
|
use SilverStripe\Dev\SapphireTest;
|
||||||
|
use SilverStripe\ORM\Tests\DataObjectTest\Fixture;
|
||||||
use SilverStripe\ORM\Tests\DataObjectTest\Bracket;
|
use SilverStripe\ORM\Tests\DataObjectTest\Bracket;
|
||||||
use SilverStripe\ORM\Tests\DataObjectTest\EquipmentCompany;
|
use SilverStripe\ORM\Tests\DataObjectTest\EquipmentCompany;
|
||||||
use SilverStripe\ORM\Tests\DataObjectTest\Fan;
|
use SilverStripe\ORM\Tests\DataObjectTest\Fan;
|
||||||
@ -940,6 +941,27 @@ class DataListTest extends SapphireTest
|
|||||||
$this->assertCount(4, $list);
|
$this->assertCount(4, $list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testFilterAnyWithTwoGreaterThanFilters()
|
||||||
|
{
|
||||||
|
|
||||||
|
for ($i=1; $i<=3; $i++) {
|
||||||
|
$f = new Fixture();
|
||||||
|
$f->MyDecimal = $i;
|
||||||
|
$f->write();
|
||||||
|
|
||||||
|
$f = new Fixture();
|
||||||
|
$f->MyInt = $i;
|
||||||
|
$f->write();
|
||||||
|
}
|
||||||
|
|
||||||
|
$list = Fixture::get()->filterAny([
|
||||||
|
'MyDecimal:GreaterThan' => 1, // 2 records
|
||||||
|
'MyInt:GreaterThan' => 2, // 1 record
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertCount(3, $list);
|
||||||
|
}
|
||||||
|
|
||||||
public function testFilterAnyMultipleArray()
|
public function testFilterAnyMultipleArray()
|
||||||
{
|
{
|
||||||
$list = TeamComment::get();
|
$list = TeamComment::get();
|
||||||
|
Loading…
Reference in New Issue
Block a user