1
0
mirror of https://github.com/danog/parallel.git synced 2024-11-27 04:44:56 +01:00
parallel/tests/Worker/ThreadPoolTest.php
2015-12-16 16:39:25 -06:00

24 lines
602 B
PHP

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