public function iAuthenticateAs($user)
    {
        if (!isset($this->users[$user])) {
            throw new ClientErrorResponseException(
                'User ' . $user . ' does not exist'
            );
        }

        $this->addGuzzleHeader(
            'Authorization',
            'Bearer ' . $this->users[$user]
        );
    }
public function iAuthenticateAs($user)
    {
        if (!isset($this->users[$user])) {
            throw new ClientErrorResponseException(
                'User ' . $user . ' does not exist'
            );
        }

        $this->addGuzzleHeader(
            'Authorization',
            'Bearer ' . $this->users[$user]
        );
    }
public function iAuthenticateAs ( $ user ) { if ( ! isset ( $ this -> users [ $ user ] ) ) { throw new ClientErrorResponseException ( 'User ' . $ user . ' does not exist' ) ; } $ this -> addGuzzleHeader ( 'Authorization' , 'Bearer ' . $ this -> users [ $ user ] ) ; }
Calls specified command

Example: Given I authenticated as "bruce.wayne"
Example: When I authenticate as "bruce.wayne"

@param string $user Key from users array to identify user

@Given /^I authenticated as "(\S+)"$/
@When /^I authenticate as "(\S+)"$/
Calls specified command