eZ\Bundle\EzPublishRestBundle\Features\Context\RestClient\DriverHelper::makeAuthentication PHP Method

makeAuthentication() protected method

Make/Crypt the authentication value.
protected makeAuthentication ( $username, string $password, string $type ) : string
$password string
$type string The type of authentication
return string Authentication value
    protected function makeAuthentication($username, $password, $type)
    {
        switch ($type) {
            case self::AUTH_TYPE_BASIC:
                return 'Basic ' . base64_encode("{$username}:{$password}");
            default:
                throw new \UnexpectedValueException("Authentication '{$authType}' invalid or not implemented yet");
        }
    }