public function amLoggedAs($user, $driver = null)
    {
        if (!$user instanceof Authenticatable) {
            $this->fail(
                'The user passed to amLoggedAs() should be an instance of \\Illuminate\\Contracts\\Auth\\Authenticatable'
            );
        }

        $guard = $auth = $this->app['auth'];

        if (method_exists($auth, 'driver')) {
            $guard = $auth->driver($driver);
        }

        if (method_exists($auth, 'guard')) {
            $guard = $auth->guard($driver);
        }

        $guard->setUser($user);
    }