mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-09-05 13:05:34 +01:00
Same conditions are kept within a filter group
This commit is contained in:
parent
1578cc81a3
commit
f700382355
2 changed files with 26 additions and 3 deletions
|
@ -26,6 +26,24 @@ class OtherwiseTest extends TestCase
|
|||
->trash()
|
||||
);
|
||||
|
||||
$this->assertCount(3, $filters->toArray());
|
||||
$this->assertCount(3, $filters->all());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function same_conditions_are_kept_between_filters()
|
||||
{
|
||||
$filters = FilterGroup::if(
|
||||
Filter::create()
|
||||
->has('to:me@example.com subject:Foo')
|
||||
->read()
|
||||
)->otherwise(
|
||||
Filter::create()
|
||||
->has('to:me@example.com subject:Bar')
|
||||
->trash()
|
||||
);
|
||||
|
||||
$filters->all()->each(function (Filter $filter) {
|
||||
$this->assertTrue($filter->getConditions()->contains('to:me@example.com'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue