1package Test2::EventFacet::Parent;
2use strict;
3use warnings;
4
5our $VERSION = '1.302175';
6
7use Carp qw/confess/;
8
9BEGIN { require Test2::EventFacet; our @ISA = qw(Test2::EventFacet) }
10use Test2::Util::HashBase qw{ -hid -children -buffered };
11
12sub init {
13    confess "Attribute 'hid' must be set"
14        unless defined $_[0]->{+HID};
15
16    $_[0]->{+CHILDREN} ||= [];
17}
18
191;
20
21__END__
22
23=pod
24
25=encoding UTF-8
26
27=head1 NAME
28
29Test2::EventFacet::Parent - Facet for events contains other events
30
31=head1 DESCRIPTION
32
33This facet is used when an event contains other events, such as a subtest.
34
35=head1 FIELDS
36
37=over 4
38
39=item $string = $parent->{details}
40
41=item $string = $parent->details()
42
43Human readable description of the event.
44
45=item $hid = $parent->{hid}
46
47=item $hid = $parent->hid()
48
49Hub ID of the hub that is represented in the parent-child relationship.
50
51=item $arrayref = $parent->{children}
52
53=item $arrayref = $parent->children()
54
55Arrayref containing the facet-data hashes of events nested under this one.
56
57I<To get the actual events you need to get them from the parent event directly>
58
59=item $bool = $parent->{buffered}
60
61=item $bool = $parent->buffered()
62
63True if the subtest is buffered (meaning the formatter has probably not seen
64them yet).
65
66=back
67
68=head1 SOURCE
69
70The source code repository for Test2 can be found at
71F<http://github.com/Test-More/test-more/>.
72
73=head1 MAINTAINERS
74
75=over 4
76
77=item Chad Granum E<lt>exodist@cpan.orgE<gt>
78
79=back
80
81=head1 AUTHORS
82
83=over 4
84
85=item Chad Granum E<lt>exodist@cpan.orgE<gt>
86
87=back
88
89=head1 COPYRIGHT
90
91Copyright 2019 Chad Granum E<lt>exodist@cpan.orgE<gt>.
92
93This program is free software; you can redistribute it and/or
94modify it under the same terms as Perl itself.
95
96See F<http://dev.perl.org/licenses/>
97
98=cut
99