{
    "mode": "perldoc",
    "parameter": "Test2::Event::V2",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Test2%3A%3AEvent%3A%3AV2/json",
    "generated": "2026-06-10T04:34:41Z",
    "synopsis": "USING A CONTEXT\nuse Test2::API qw/context/;\nsub mytool {\nmy $ctx = context();\nmy $event = $ctx->sendev2(info => [{tag => 'NOTE', details => \"This is a note\"}]);\n$ctx->release;\nreturn $event;\n}\nUSING THE CONSTRUCTOR\nuse Test2::Event::V2;\nmy $e = Test2::Event::V2->new(\ntrace => {frame => [$PKG, $FILE, $LINE, $SUBNAME]},\ninfo  => [{tag => 'NOTE', details => \"This is a note\"}],\n);",
    "sections": {
        "NAME": {
            "content": "Test2::Event::V2 - Second generation event.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This is the event type that should be used instead of Test2::Event or its legacy subclasses.\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "USING A CONTEXT\nuse Test2::API qw/context/;\n\nsub mytool {\nmy $ctx = context();\n\nmy $event = $ctx->sendev2(info => [{tag => 'NOTE', details => \"This is a note\"}]);\n\n$ctx->release;\n\nreturn $event;\n}\n\nUSING THE CONSTRUCTOR\nuse Test2::Event::V2;\n\nmy $e = Test2::Event::V2->new(\ntrace => {frame => [$PKG, $FILE, $LINE, $SUBNAME]},\ninfo  => [{tag => 'NOTE', details => \"This is a note\"}],\n);\n",
            "subsections": []
        },
        "METHODS": {
            "content": "This class inherits from Test2::Event.\n\n$fd = $e->facetdata()\nThis will return a hashref of facet data. Each facet hash will be a shallow copy of the\noriginal.\n\n$about = $e->about()\nThis will return the 'about' facet hashref.\n\nNOTE: This will return the internal hashref, not a copy.\n\n$trace = $e->trace()\nThis will return the 'trace' facet, normally blessed (but this is not enforced when the\ntrace is set using \"settrace()\".\n\nNOTE: This will return the internal trace, not a copy.\n\nMUTATION\n$e->addamnesty({...})\nInherited from Test2::Event. This can be used to add 'amnesty' facets to an existing event.\nEach new item is added to the END of the list.\n\nNOTE: Items ARE blessed when added.\n\n$e->addhub({...})\nInherited from Test2::Event. This is used by hubs to stamp events as they pass through. New\nitems are added to the START of the list.\n\nNOTE: Items ARE NOT blessed when added.\n\n$e->setuuid($UUID)\nInherited from Test2::Event, overridden to also vivify/mutate the 'about' facet.\n\n$e->settrace($trace)\nInherited from Test2::Event which allows you to change the trace.\n\nNote: This method does not bless/clone the trace for you. Many things will expect the trace\nto be blessed, so you should probably do that.\n\nLEGACY SUPPORT METHODS\nThese are all imported from Test2::Util::Facets2Legacy, see that module or Test2::Event for\ndocumentation on what they do.\n\ncausesfail\ndiagnostics\nglobal\nincrementscount\nnodisplay\nsetsplan\nsubtestid\nsummary\nterminate\n",
            "subsections": []
        },
        "THIRD PARTY META-DATA": {
            "content": "This object consumes Test2::Util::ExternalMeta which provides a consistent way for you to attach\nmeta-data to instances of this class. This is useful for tools, plugins, and other extensions.\n",
            "subsections": []
        },
        "SOURCE": {
            "content": "The source code repository for Test2 can be found at http://github.com/Test-More/test-more/.\n",
            "subsections": []
        },
        "MAINTAINERS": {
            "content": "Chad Granum <exodist@cpan.org>\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Chad Granum <exodist@cpan.org>\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 2020 Chad Granum <exodist@cpan.org>.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n\nSee http://dev.perl.org/licenses/\n",
            "subsections": []
        }
    },
    "summary": "Test2::Event::V2 - Second generation event.",
    "flags": [],
    "examples": [],
    "see_also": []
}