From 9e863cfc7f5f269edb4a1f4c2abc8e7cf00d7f77 Mon Sep 17 00:00:00 2001 From: Joop Schilder Date: Mon, 14 Dec 2020 14:32:50 +0100 Subject: [PATCH] Remove unnecessary builder method --- src/ContextBuilder.php | 7 ------- src/Tests/ContextBuilderTest.php | 12 ------------ 2 files changed, 19 deletions(-) diff --git a/src/ContextBuilder.php b/src/ContextBuilder.php index 22cd78b..b83b70a 100644 --- a/src/ContextBuilder.php +++ b/src/ContextBuilder.php @@ -32,13 +32,6 @@ class ContextBuilder return $instance; } - public function withWorkers(Workers $workers): self - { - $instance = clone $this; - $instance->workers = $workers; - return $instance; - } - public function withCleanupInterval(Interval $interval): self { $instance = clone $this; diff --git a/src/Tests/ContextBuilderTest.php b/src/Tests/ContextBuilderTest.php index c888e9a..752f4f8 100644 --- a/src/Tests/ContextBuilderTest.php +++ b/src/Tests/ContextBuilderTest.php @@ -7,7 +7,6 @@ use React\EventLoop\LoopInterface; use Toalett\Multiprocessing\Concurrency; use Toalett\Multiprocessing\ContextBuilder; use Toalett\Multiprocessing\Tests\Tools\PropertyInspector; -use Toalett\Multiprocessing\Workers; class ContextBuilderTest extends TestCase { @@ -66,15 +65,4 @@ class ContextBuilderTest extends TestCase self::assertSame($concurrency, $usedConcurrency); } - - public function testWhenGivenWorkersItUsesThatWorkers(): void - { - $builder = ContextBuilder::create(); - $workers = $this->createMock(Workers::class); - - $context = $builder->withWorkers($workers)->build(); - $usedWorkers = $this->getProperty($context, 'workers'); - - self::assertSame($workers, $usedWorkers); - } }