public function testApiStopThreads_ResolvesPromise_WhenAllThreadsAreStopped()
{
$manager = $this->createThreadManager(['stopThread']);
$manager->expects($this->twice())->method('stopThread')->will($this->returnValue(new PromiseFulfilled()));
$manager->allocateThread($alias1 = 'alias1', $object1 = new StdClass());
$manager->allocateThread($alias2 = 'alias2', $object2 = new StdClass());
$aliases = [$alias1, $alias2];
$callable = $this->createCallableMock();
$callable->expects($this->once())->method('__invoke')->with($this->isType('string'));
$manager->stopThreads($aliases)->then($callable);
}