public function test__delete() { $promise = $this->object->make(); $id = $promise->getId(); $result = $this->object->delete($id); $this->assertTrue($result); $this->setExpectedException('\\zaboy\\async\\Promise\\PromiseException'); $promise = $this->object->get($id)->getState(); $this->assertFalse($this->object->delete($id)); }
/** * Reads a content of log-files of specified process * * @param $row * @throws \Exception */ public function postFinishProcess($row) { $errors = $this->parser->parseFile($row['stderr']); $output = $this->parser->parseFile($row['stdout']); $promise = $this->promiseBroker->get($row['promiseId']); if ($errors['fatalStatus']) { $promise->reject($errors['message']); } else { $promise->resolve($output['message'] . PHP_EOL . $errors['message']); } }