/** * @Given /^I request a token with a (.*) username, (.*) password, (.*) grand_type, (.*) client_id and (.*) client_secret$/ */ public function iRequestATokenWithAUsernamePasswordGrand_typeClient_idAndClient_secret($username, $password, $grand_type, $client_id, $client_secret) { // $parameter["{$username}_username"] // $parameter["{$password}_password"] // $parameter["{$grand_type}_grand_type"] // $parameter["{$client_id}_client_id"] // $parameter["{$client_secret}_client_secret"] $my_api = new test_API("test.api.com"); try { self::$api_response = $my_api->getToken(self::$parameter["{$grand_type}_grand_type"], self::$parameter["{$username}_username"], self::$parameter["{$password}_password"], self::$parameter["{$client_id}_client_id"], self::$parameter["{$client_secret}_client_secret"]); //var_dump(self::$api_response); } catch (Exception $e) { // Process the error throw new Exception($e->getMessage()); } }