public function testExceptionParseMessage() { $par1 = uniqid(); $par2 = uniqid(); $message = ['details' => ['error' => ['validationErrors' => [['validationError' => ['message' => '%s %s', 'parameters' => [$par1, $par2]]]]]]]; $e = Exception::configurationError($message); $this->assertNotEquals($message, $e->getMessage()); $json = json_decode($e->getMessage(), true); $this->assertCount(1, $json); $this->assertEquals("{$par1} {$par2}", $json[0]); }
public function refreshToken() { try { $this->request('GET', '/gdc/account/token'); } catch (Exception $e) { throw Exception::loginError($e); } }