File Coverage

blib/lib/Test/Shared/Fixture/Wikibase/Datatype/Item/Wikidata/Dog.pm
Criterion Covered Total %
statement 34 34 100.0
branch n/a
condition n/a
subroutine 11 11 100.0
pod 1 1 100.0
total 46 46 100.0


line stmt bran cond sub pod time code
1             package Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog;
2              
3 3     3   357953 use base qw(Wikibase::Datatype::Item);
  3         6  
  3         1822  
4 3     3   26 use strict;
  3         7  
  3         133  
5 3     3   19 use warnings;
  3         8  
  3         219  
6              
7 3     3   2505 use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism;
  3         15  
  3         159  
8 3     3   2041 use Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::NumberOfLimbs::Four;
  3         41  
  3         152  
9 3     3   1588 use Unicode::UTF8 qw(decode_utf8);
  3         2345  
  3         300  
10 3     3   1748 use Wikibase::Datatype::Sitelink;
  3         13  
  3         128  
11 3     3   24 use Wikibase::Datatype::Statement;
  3         7  
  3         90  
12 3     3   15 use Wikibase::Datatype::Term;
  3         7  
  3         73  
13 3     3   16 use Wikibase::Datatype::Value::Item;
  3         6  
  3         1265  
14              
15             our $VERSION = 0.39;
16              
17             sub new {
18 1     1 1 305322 my $class = shift;
19              
20 1         19 my @params = (
21             'aliases' => [
22             Wikibase::Datatype::Term->new(
23             'language' => 'cs',
24             'value' => decode_utf8('pes domácí'),
25             ),
26             Wikibase::Datatype::Term->new(
27             'language' => 'en',
28             'value' => 'domestic dog',
29             ),
30             Wikibase::Datatype::Term->new(
31             'language' => 'en',
32             'value' => 'Canis lupus familiaris',
33             ),
34             Wikibase::Datatype::Term->new(
35             'language' => 'en',
36             'value' => 'Canis familiaris',
37             ),
38             Wikibase::Datatype::Term->new(
39             'language' => 'en',
40             'value' => 'dogs',
41             ),
42             Wikibase::Datatype::Term->new(
43             'language' => 'en',
44             'value' => decode_utf8('🐶'),
45             ),
46             Wikibase::Datatype::Term->new(
47             'language' => 'en',
48             'value' => decode_utf8('🐕'),
49             ),
50             ],
51             'descriptions' => [
52             Wikibase::Datatype::Term->new(
53             'language' => 'cs',
54             'value' => decode_utf8('domácí zvíře'),
55             ),
56             Wikibase::Datatype::Term->new(
57             'language' => 'en',
58             'value' => 'domestic animal',
59             ),
60             ],
61             'labels' => [
62             Wikibase::Datatype::Term->new(
63             'language' => 'cs',
64             'value' => 'pes',
65             ),
66             Wikibase::Datatype::Term->new(
67             'language' => 'en',
68             'value' => 'dog',
69             ),
70             ],
71             'id' => 'Q144',
72             'lastrevid' => 1539465460,
73             'modified' => '2021-12-06T14:48:31Z',
74             'ns' => 0,
75             'page_id' => 280,
76             'sitelinks' => [
77             Wikibase::Datatype::Sitelink->new(
78             'site' => 'enwiki',
79             'title' => 'Dog',
80             ),
81             ],
82             'statements' => [
83             Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism->new,
84             Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::NumberOfLimbs::Four->new,
85             ],
86             'title' => 'Q144',
87             );
88              
89 1         15 my $self = $class->SUPER::new(@params);
90              
91 1         15 return $self;
92             }
93              
94             1;
95              
96             __END__
97              
98             =pod
99              
100             =encoding utf8
101              
102             =head1 NAME
103              
104             Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog - Test instance for Wikidata item.
105              
106             =head1 SYNOPSIS
107              
108             use Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog;
109              
110             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog->new;
111             my $aliases_ar = $obj->aliases;
112             my $descriptions_ar = $obj->descriptions;
113             my $id = $obj->id;
114             my $labels_ar = $obj->labels;
115             my $lastrevid = $obj->lastrevid;
116             my $modified = $obj->modified;
117             my $ns = $obj->ns;
118             my $page_id = $obj->page_id;
119             my $sitelinks_ar = $obj->sitelinks;
120             my $statements_ar = $obj->statements;
121             my $title = $obj->title;
122              
123             =head1 METHODS
124              
125             =head2 C<new>
126              
127             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog->new;
128              
129             Constructor.
130              
131             Returns instance of object.
132              
133             =head2 C<aliases>
134              
135             my $aliases_ar = $obj->aliases;
136              
137             Get aliases.
138              
139             Returns reference to array with Wikibase::Datatype::Term instances.
140              
141             =head2 C<descriptions>
142              
143             my $descriptions_ar = $obj->descriptions;
144              
145             Get descriptions.
146              
147             Returns reference to array with Wikibase::Datatype::Term instances.
148              
149             =head2 C<id>
150              
151             my $id = $obj->id;
152              
153             Get id.
154              
155             Returns string.
156              
157             =head2 C<labels>
158              
159             my $labels_ar = $obj->labels;
160              
161             Get labels.
162              
163             Returns reference to array with Wikibase::Datatype::Term instances.
164              
165             =head2 C<lastrevid>
166              
167             my $lastrevid = $obj->lastrevid;
168              
169             Get last revision ID.
170              
171             Returns string.
172              
173             =head2 C<modified>
174              
175             my $modified = $obj->modified;
176              
177             Get date of modification.
178              
179             Returns string.
180              
181             =head2 C<ns>
182              
183             my $ns = $obj->ns;
184              
185             Get namespace.
186              
187             Returns number.
188              
189             =head2 C<page_id>
190              
191             my $page_id = $obj->page_id;
192              
193             Get page id.
194              
195             Returns number.
196              
197             =head2 C<sitelinks>
198              
199             my $sitelinks_ar = $obj->sitelinks;
200              
201             Get sitelinks.
202              
203             Returns reference to array with Wikibase::Datatype::Sitelink instances.
204              
205             =head2 C<statements>
206              
207             my $statements_ar = $obj->statements;
208              
209             Get statements.
210              
211             Returns reference to array with Wikibase::Datatype::Statement instances.
212              
213             =head2 C<title>
214              
215             my $title = $obj->title;
216              
217             Get title.
218              
219             Returns string.
220              
221             =head1 EXAMPLE
222              
223             =for comment filename=fixture_create_and_print_item_wd_dog.pl
224              
225             use strict;
226             use warnings;
227              
228             use Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog;
229             use Unicode::UTF8 qw(encode_utf8);
230             use Wikibase::Datatype::Print::Item;
231              
232             # Object.
233             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Item::Wikidata::Dog->new;
234              
235             # Print out.
236             print encode_utf8(scalar Wikibase::Datatype::Print::Item::print($obj));
237              
238             # Output:
239             # Label: dog (en)
240             # Description: domestic animal (en)
241             # Aliases:
242             # domestic dog (en)
243             # Canis lupus familiaris (en)
244             # Canis familiaris (en)
245             # dogs (en)
246             # 🐶 (en)
247             # 🐕 (en)
248             # Sitelinks:
249             # Dog (enwiki)
250             # Statements:
251             # P31: Q55983715 (normal)
252             # P642: Q20717272
253             # P642: Q26972265
254             # P123456789: 4 (normal)
255              
256             =head1 DEPENDENCIES
257              
258             L<Test::Shared::Fixture::Wikibase::Datatype::Statement::Wikidata::InstanceOf::CommonLivingOrganism>,
259             L<Unicode::UTF8>,
260             L<Wikibase::Datatype::Sitelink>,
261             L<Wikibase::Datatype::Statement>,
262             L<Wikibase::Datatype::Snak>,
263             L<Wikibase::Datatype::Term>,
264             L<Wikibase::Datatype::Value::Item>.
265              
266             =head1 SEE ALSO
267              
268             =over
269              
270             =item L<Wikibase::Datatype>
271              
272             Wikibase datatypes.
273              
274             =item L<Wikibase::Datatype::Item>
275              
276             Wikibase item datatype.
277              
278             =back
279              
280             =head1 REPOSITORY
281              
282             L<https://github.com/michal-josef-spacek/Wikibase-Datatype>
283              
284             =head1 AUTHOR
285              
286             Michal Josef Špaček L<mailto:skim@cpan.org>
287              
288             L<http://skim.cz>
289              
290             =head1 LICENSE AND COPYRIGHT
291              
292             © 2020-2025 Michal Josef Špaček
293              
294             BSD 2-Clause License
295              
296             =head1 VERSION
297              
298             0.39
299              
300             =cut