mirror of
https://github.com/opdavies/gmail-filter-builder.git
synced 2025-09-01 03:18:31 +01:00
wip
This commit is contained in:
parent
654457beee
commit
77ab5d9f9b
3 changed files with 56 additions and 2 deletions
39
tests/Unit/BuilderTest.php
Normal file
39
tests/Unit/BuilderTest.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?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();
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue