public function testOtherwiseIsSugarForRejections() { $p = new Promise(); $p->reject('foo'); $p->otherwise(function ($v) use(&$c) { $c = $v; }); P\queue()->run(); $this->assertEquals($c, 'foo'); }
public function otherwise(callable $onRejected) { return $this->result->otherwise($onRejected); }