Split properties into conditions and actions

This commit is contained in:
Oliver Davies 2019-12-28 23:54:26 +00:00
parent 560ede60db
commit 778374b2c9
5 changed files with 114 additions and 91 deletions

View file

@ -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;

View file

@ -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';
}
}