1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-12 17:17:20 +01:00
parallel/test/Worker/ThreadPoolTest.php
2016-08-21 23:40:48 -05:00

21 lines
568 B
PHP

<?php declare(strict_types = 1);
namespace Amp\Concurrent\Test\Worker;
use Amp\Concurrent\Worker\{ DefaultPool, WorkerFactory, WorkerThread };
/**
* @group threading
* @requires extension pthreads
*/
class ThreadPoolTest extends AbstractPoolTest {
protected function createPool($min = null, $max = null) {
$factory = $this->createMock(WorkerFactory::class);
$factory->method('create')->will($this->returnCallback(function () {
return new WorkerThread();
}));
return new DefaultPool($min, $max, $factory);
}
}