mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-09-05 13:05:34 +01:00
A filter group contains the correct number of filters
This commit is contained in:
parent
7cabd2fb2f
commit
af985e8b37
2 changed files with 68 additions and 0 deletions
31
tests/OtherwiseTest.php
Normal file
31
tests/OtherwiseTest.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Opdavies\GmailFilterBuilder;
|
||||
|
||||
use Opdavies\GmailFilterBuilder\Model\Filter;
|
||||
use Opdavies\GmailFilterBuilder\Model\FilterGroup;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
class OtherwiseTest extends TestCase
|
||||
{
|
||||
|
||||
/** @test */
|
||||
public function it_returns_the_correct_number_of_filters()
|
||||
{
|
||||
$filters = FilterGroup::if(
|
||||
Filter::create()
|
||||
->has('to:me@example.com foo')
|
||||
->labelAndArchive('Test')
|
||||
)->otherwise(
|
||||
Filter::create()
|
||||
->has('to:me@example.com bar')
|
||||
->read()
|
||||
)->otherwise(
|
||||
Filter::create()
|
||||
->has('to:me@example.com')
|
||||
->trash()
|
||||
);
|
||||
|
||||
$this->assertCount(3, $filters->toArray());
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue