You are viewing the version of this documentation from Perl 5.42.0-RC2. This is a development version of Perl.

CONTENTS

NAME

Test2::Event::Generic - Generic event type.

DESCRIPTION

This is a generic event that lets you customize all fields in the event API. This is useful if you have need for a custom event that does not make sense as a published reusable event subclass.

SYNOPSIS

use Test2::API qw/context/;

sub send_custom_fail {
    my $ctx = shift;

    $ctx->send_event('Generic', causes_fail => 1, summary => 'The sky is falling');

    $ctx->release;
}

send_custom_fail();

METHODS

$e->facet_data($data)
$data = $e->facet_data

Get or set the facet data (see Test2::Event). If no facet_data is set then Test2::Event->facet_data will be called to produce facets from the other data.