Remove unnecessary builder method

This commit is contained in:
Joop Schilder 2020-12-14 14:32:50 +01:00
parent 0a4865f597
commit 9e863cfc7f
2 changed files with 0 additions and 19 deletions

View File

@ -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;

View File

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