File Coverage

blib/lib/Test/Shared/Fixture/Data/InfoBox/Company.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 39 39 100.0


line stmt bran cond sub pod time code
1             package Test::Shared::Fixture::Data::InfoBox::Company;
2              
3 4     4   456363 use base qw(Data::InfoBox);
  4         7  
  4         2071  
4 4     4   32 use strict;
  4         6  
  4         113  
5 4     4   32 use warnings;
  4         11  
  4         184  
6              
7 4     4   1929 use Data::Icon;
  4         318965  
  4         173  
8 4     4   2067 use Data::InfoBox::Item;
  4         15  
  4         142  
9 4     4   1886 use Data::Text::Simple;
  4         1212285  
  4         188  
10 4     4   1659 use Unicode::UTF8 qw(decode_utf8);
  4         2642  
  4         273  
11 4     4   2964 use Test::Shared::Fixture::Data::InfoBox::Address;
  4         20  
  4         811  
12              
13             our $VERSION = 0.07;
14              
15             sub new {
16 2     2 1 395747 my $class = shift;
17              
18             my @params = (
19             'items' => [
20             Data::InfoBox::Item->new(
21             'text' => Data::Text::Simple->new(
22             'text' => 'Volvox Globator',
23             ),
24             'uri' => 'https://volvox.cz',
25             ),
26 2         77 @{Test::Shared::Fixture::Data::InfoBox::Address->new->items},
  2         33  
27             Data::InfoBox::Item->new(
28             'icon' => Data::Icon->new(
29             'char' => decode_utf8('✉'),
30             ),
31             'text' => Data::Text::Simple->new(
32             'text' => 'volvox@volvox.cz',
33             ),
34             'uri' => 'mailto:volvox@volvox.cz',
35             ),
36             Data::InfoBox::Item->new(
37             'icon' => Data::Icon->new(
38             'char' => decode_utf8('☎'),
39             ),
40             'text' => Data::Text::Simple->new(
41             'text' => '+420739639506',
42             ),
43             'uri' => 'tel:+420739639506',
44             ),
45             ],
46             );
47              
48 2         102 my $self = $class->SUPER::new(@params);
49              
50 2         20 return $self;
51             }
52              
53             1;
54              
55             __END__
56              
57             =pod
58              
59             =encoding utf8
60              
61             =head1 NAME
62              
63             Test::Shared::Fixture::Data::InfoBox::Company - Company info box fixture.
64              
65             =head1 SYNOPSIS
66              
67             use Test::Shared::Fixture::Data::InfoBox::Company;
68              
69             my $obj = Test::Shared::Fixture::Data::InfoBox::Company->new;
70             my $items_ar = $obj->items;
71              
72             =head1 METHODS
73              
74             =head2 C<new>
75              
76             my $obj = Test::Shared::Fixture::Data::InfoBox::Company->new;
77              
78             Constructor.
79              
80             Returns instance of object.
81              
82             =head2 C<items>
83              
84             my $items_ar = $obj->items;
85              
86             Get list of items in info box.
87              
88             Returns reference to array with L<Data::InfoBox::Item> objects.
89              
90             =head1 EXAMPLE
91              
92             =for comment filename=create_company_fixture_object_and_print.pl
93              
94             use strict;
95             use warnings;
96              
97             use Test::Shared::Fixture::Data::InfoBox::Company;
98             use Unicode::UTF8 qw(encode_utf8);
99              
100             my $obj = Test::Shared::Fixture::Data::InfoBox::Company->new;
101              
102             # Print out.
103             my $num = 0;
104             foreach my $item (@{$obj->items}) {
105             $num++;
106             print "Item $num: ".encode_utf8($item->text->text)."\n";
107             }
108              
109             # Output:
110             # Item 1: Volvox Globator
111             # Item 2: Prvního pluku 211/5
112             # Item 3: Karlín
113             # Item 4: 18600 Praha 8
114             # Item 5: volvox@volvox.cz
115             # Item 6: +420739639506
116              
117             =head1 DEPENDENCIES
118              
119             L<Data::InfoBox>,
120             L<Data::InfoBox::Item>,
121             L<Data::Text::Simple>,
122             L<Unicode::UTF8>.
123              
124             =head1 REPOSITORY
125              
126             L<https://github.com/michal-josef-spacek/Data-InfoBox>
127              
128             =head1 AUTHOR
129              
130             Michal Josef Špaček L<mailto:skim@cpan.org>
131              
132             L<http://skim.cz>
133              
134             =head1 LICENSE AND COPYRIGHT
135              
136             © 2024-2025 Michal Josef Špaček
137              
138             BSD 2-Clause License
139              
140             =head1 VERSION
141              
142             0.07
143              
144             =cut