/** * Copy temporary process allocation data to persistent storage. * * @param string[] $with * @throws ReadException */ private function updateStorage($with = []) { $data = []; foreach ($this->processes as $processAlias => $process) { $data[$processAlias] = $process; } $data = array_merge($data, $with); $this->fs->create($this->fsPath, json_encode($data)); }
/** * */ public function testApiCreate_ThrowsException_WhenLegueWriteThrowsException() { $path = 'path'; $contents = 'contents'; $expected = new Exception(); $ex = null; $this->expect('put', [$path, $contents])->willThrow($expected); try { $this->fs->create($path, $contents); } catch (Exception $ex) { } $this->assertInstanceOf(WriteException::class, $ex); $this->assertSame($expected, $ex->getPrevious()); }
/** * Copy temporary project data to persistent storage. * * @param string[] $with * @throws ReadException */ private function updateStorage($with = []) { $data = array_merge($this->data, $with); $this->fs->create($this->fsPath, json_encode($data)); }