mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-09-07 05:55:33 +01:00
Split properties into conditions and actions
This commit is contained in:
parent
560ede60db
commit
778374b2c9
5 changed files with 114 additions and 91 deletions
|
@ -33,8 +33,8 @@ class BuilderTest extends TestCase
|
|||
</entry>
|
||||
<entry>
|
||||
<apps:property name='hasTheWord' value='from:bar@example.com'/>
|
||||
<apps:property name='shouldStar' value='true'/>
|
||||
<apps:property name='shouldAlwaysMarkAsImportant' value='true'/>
|
||||
<apps:property name='shouldStar' value='true'/>
|
||||
</entry>
|
||||
</feed>
|
||||
EOF;
|
||||
|
|
|
@ -15,10 +15,9 @@ class PartialsTest extends TestCase
|
|||
$filters = FakePartials::load('filters');
|
||||
|
||||
$this->assertCount(3, $filters);
|
||||
|
||||
$this->assertSame('foo@example.com', $filters[0]->toArray()['from'][0]);
|
||||
$this->assertSame('bar@example.com', $filters[1]->toArray()['from'][0]);
|
||||
$this->assertSame('baz@example.com', $filters[2]->toArray()['from'][0]);
|
||||
$this->assertSame(['foo@example.com'], $filters[0]->getConditions()['from']);
|
||||
$this->assertSame(['bar@example.com'], $filters[1]->getConditions()['from']);
|
||||
$this->assertSame(['baz@example.com'], $filters[2]->getConditions()['from']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,6 +28,6 @@ class FakePartials extends Partials
|
|||
*/
|
||||
protected static function getFilePattern($directoryName): string
|
||||
{
|
||||
return __DIR__ . '/../../stubs/filters/*.php';
|
||||
return 'tests/stubs/filters/*.php';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue