mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-03-13 05:26:57 +00:00
25 lines
806 B
PHP
25 lines
806 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|