Test2::Event::Plan(3) User Contributed Perl Documentation Test2::Event::Plan(3)

# [NAME](#NAME)

Test2::Event::Plan - The event of a plan

# [DESCRIPTION](#DESCRIPTION)

Plan events are fired off whenever a plan is declared, done testing is called, or a subtext completes.

# [SYNOPSIS](#SYNOPSIS)

```
    use Test2::API qw/context/;
    use Test2::Event::Plan;
    my $ctx = context();
    # Plan for 10 tests to run
    my $event = $ctx->plan(10);
    # Plan to skip all tests (will exit 0)
    $ctx->plan(0, skip_all => "These tests need to be skipped");
```

# [ACCESSORS](#ACCESSORS)

$num = $plan-&gt;max

Get the number of expected tests

$dir = $plan-&gt;directive

Get the directive (such as TODO, skip\_all, or no\_plan).

$reason = $plan-&gt;reason

Get the reason for the directive.

# [SOURCE](#SOURCE)

The source code repository for Test2 can be found at &lt;https://github.com/Test-More/test-more/&gt;.

# [MAINTAINERS](#MAINTAINERS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad)

# [AUTHORS](#AUTHORS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad~2)

# [COPYRIGHT](#COPYRIGHT)

Copyright Chad Granum &lt;exodist@cpan.org&gt;.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See &lt;https://dev.perl.org/licenses/&gt;

2026-09-04 perl v5.44.0

---

Document: Test2::Event::Plan(3pm) from perl-test-simple 1.302225-r0 (Chainguard OS)
Source: https://github.com/Test-More/test-more
