gmail-filter-builder/tests/Unit/BuilderTest.php
2017-11-04 09:38:14 +00:00

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();
}
}