createMock(Pool::class); $mock->expects($this->once()) ->method("enqueue") ->willReturn(new Success(1)); $callable = parallel(function () { return 0; }, $mock); $this->assertSame(1, Promise\wait($callable())); } }