Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

GitLab::API::v4::Mock::Engine

Name GitLab::API::v4::Mock::Engine
Version 0.26
Located at /usr/share/perl5
File /usr/share/perl5/GitLab/API/v4/Mock/Engine.pm
Is Core No
Search CPAN for this module GitLab::API::v4::Mock::Engine
Documentation GitLab::API::v4::Mock::Engine
Module Details GitLab::API::v4::Mock::Engine


NAME

GitLab::API::v4::Mock::Engine - Mocking the internals of a GitLab server.


SYNOPSIS

    use GitLab::API::v4::Mock::Engine;

    my $engine = GitLab::API::v4::Mock::Engine->new();

    my $user = $engine->create_user({
        email    => $email,
        username => $username,
        name     => $name,
        ...,
    });

    print "User created with ID: $user->{id}\n";


DESCRIPTION

This module provides the tooling to run a mock of the internal state of a GitLab server.

At this time very little is validated. For example, when you create a user with create_user there is no logic which double checks that you specify the required email field or that you don't put in fields that are unexpected.


ATTRIBUTES

next_ids

    my $ids = $engine->next_ids();

A hash reference containing object types to the next ID.

Used by next_id_for.

users

    my $users = $engine->users();
    foreach my $user (@$users) { ... }

Returns the full array reference of all users hash references.


METHODS

next_id_for

    my $id = $engine->next_id_for( 'user' );

Given an object type this will return the next unused ID.


USER METHODS

user

    my $user = $engine->user( $id );

Returns a user hash reference for the given ID.

If no user is found with the ID then undef is returned.

create_user

    my $user = $engine->create_user( $user );
    my $id = $user->{id};

Takes a user hash reference, sets the id field, and stores it in users.

Returns the updated user hash reference.

update_user

    my $user = $engine->update_user( $id, $new_user_data );

Takes the ID of the user to update and a hash reference of fields to update.

Returns the updated user hash reference.

delete_user

    my $user = $engine->delete_user( $id );

Deletes the user with the specified ID from users.

If no user is found with the ID then undef is returned. Otherwise the user hash reference is returned.


SUPPORT

See SUPPORT in the GitLab::API::v4 manpage.


AUTHORS

See AUTHORS in the GitLab::API::v4 manpage.


COPYRIGHT AND LICENSE

See COPYRIGHT AND LICENSE in the GitLab::API::v4 manpage.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026