mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-02-02 08:57:31 +00:00
Start adding tests
This commit is contained in:
parent
dcab51d3f9
commit
ff0c07a560
24
tests/GmailFilterTest.php
Normal file
24
tests/GmailFilterTest.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
class GmailFilterTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSingleFrom() {
|
||||
$filters[] = GmailFilter::create()
|
||||
->from(['foo@example.com']);
|
||||
|
||||
// TODO: Does this need to be done each time?
|
||||
$builder = (string) new GmailFilterBuilder($filters);
|
||||
|
||||
$this->assertContains('<apps:property name=\'from\' value=\'foo@example.com\'/>', $builder);
|
||||
}
|
||||
|
||||
public function testMultipleFrom() {
|
||||
$filters[] = GmailFilter::create()
|
||||
->from(['foo@example.com', 'bar@example.com']);
|
||||
|
||||
// TODO: Does this need to be done each time?
|
||||
$builder = (string) new GmailFilterBuilder($filters);
|
||||
|
||||
$this->assertContains('<apps:property name=\'from\' value=\'foo@example.com OR bar@example.com\'/>', $builder);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue