public function testApiStop_EmitsEvents()
{
$loop = $this->getMock(Loop::class, [], [], '', false);
$loop->expects($this->once())->method('stop');
$runtime = $this->createRuntime(['getLoop']);
$runtime->expects($this->atLeastOnce())->method('getLoop')->will($this->returnValue($loop));
$runtime->on('stop', $this->expectCallableOnce());
$runtime->stop();
}