mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-01-22 20:17:31 +00:00
40 lines
977 B
PHP
40 lines
977 B
PHP
<?php
|
|
|
|
use Opdavies\GmailFilterBuilder\Builder;
|
|
use Opdavies\GmailFilterBuilder\Filter;
|
|
|
|
class BuilderTest extends \PHPUnit_Framework_TestCase
|
|
{
|
|
public function testBuild()
|
|
{
|
|
$filterA = $this->getMockBuilder(Filter::class)
|
|
->setMethods(['getProperties'])
|
|
->getMock();
|
|
|
|
$filterB = $this->getMockBuilder(Filter::class)
|
|
->setMethods(['getProperties'])
|
|
->getMock();
|
|
|
|
$filterA->method('getProperties')
|
|
->willReturn(
|
|
[
|
|
['from' => 'foo@example.com'],
|
|
['shouldStar' => true],
|
|
]
|
|
);
|
|
|
|
$filterB->method('getProperties')
|
|
->willReturn(
|
|
[
|
|
['to' => 'bar@example.com'],
|
|
]
|
|
);
|
|
|
|
$builder = new Builder([
|
|
$filterA->getProperties(),
|
|
$filterB->getProperties(),
|
|
]);
|
|
$builder->build();
|
|
}
|
|
}
|