---
name: "GitLab::API::v4::Mock"
section: "3pm"
platform: "linux"
package: "libgitlab-api-v4-perl"
version: "0.27-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/GitLab::API::v4::Mock"
---

# GitLab::API::v4::Mock(3pm)

Mock API object for testing.

## NAME

GitLab::API::v4::Mock - Mock API object for testing.

## SYNOPSIS

```
    use GitLab::API::v4::Mock;

    my $api = GitLab::API::v4::Mock->new();
```

## DESCRIPTION

This module is a subclass of GitLab::API::v4.  It modifies it to mock the REST client via GitLab::API::v4::Mock::RESTClient.

This module is meant to be used for writing unit tests.

## ATTRIBUTES

### url

This attribute is altered from "url" in GitLab::API::v4 to default to `"https://example.com/api/v4"` and to not be required.

### rest\_client\_class

This attribute is altered from "rest\_client\_class" in GitLab::API::v4 to default to GitLab::API::v4::Mock::RESTClient.

## SUPPORT

See "SUPPORT" in GitLab::API::v4.

## AUTHORS

See "AUTHORS" in GitLab::API::v4.

## LICENSE

See "LICENSE" in GitLab::API::v4.
