From 77ab5d9f9bedce57082dd662304ee6162ba7622c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 4 Nov 2017 00:32:39 +0000 Subject: [PATCH] wip --- src/Builder.php | 16 ++++++++++++++++ tests/Unit/BuilderTest.php | 39 ++++++++++++++++++++++++++++++++++++++ tests/Unit/FilterTest.php | 3 +-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 src/Builder.php create mode 100644 tests/Unit/BuilderTest.php diff --git a/src/Builder.php b/src/Builder.php new file mode 100644 index 0000000..094795d --- /dev/null +++ b/src/Builder.php @@ -0,0 +1,16 @@ +filters = $filters; + } + + public function build() + { + } +} diff --git a/tests/Unit/BuilderTest.php b/tests/Unit/BuilderTest.php new file mode 100644 index 0000000..d8a83d0 --- /dev/null +++ b/tests/Unit/BuilderTest.php @@ -0,0 +1,39 @@ +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(); + } +} diff --git a/tests/Unit/FilterTest.php b/tests/Unit/FilterTest.php index f9e9ee7..1dd3a1c 100644 --- a/tests/Unit/FilterTest.php +++ b/tests/Unit/FilterTest.php @@ -56,8 +56,7 @@ class FilterTest extends \PHPUnit_Framework_TestCase // Ensure that we can set multiple from addresses. $this->assertEquals( ['from' => ['foo@example.com', 'bar@example.com']], - $this->filter - ->from('foo@example.com', 'bar@example.com') + $this->filter->from('foo@example.com', 'bar@example.com') ->getProperties() ); }