1
0
mirror of https://github.com/danog/parallel.git synced 2024-12-04 10:38:30 +01:00
parallel/tests/Worker/ThreadPoolTest.php

22 lines
546 B
PHP
Raw Normal View History

<?php
namespace Icicle\Tests\Concurrent\Worker;
2016-01-23 07:00:56 +01:00
use Icicle\Concurrent\Worker\{DefaultPool, WorkerFactory, WorkerThread};
/**
* @group threading
* @requires extension pthreads
*/
class ThreadPoolTest extends AbstractPoolTest
{
2015-12-16 23:39:25 +01:00
protected function createPool($min = null, $max = null)
{
2015-12-12 06:28:44 +01:00
$factory = $this->getMock(WorkerFactory::class);
$factory->method('create')->will($this->returnCallback(function () {
return new WorkerThread();
}));
return new DefaultPool($min, $max, $factory);
}
}