File Coverage

blib/lib/Test/Shared/Fixture/Wikibase/Datatype/Reference/Wikidata/VIAF.pm
Criterion Covered Total %
statement 31 31 100.0
branch n/a
condition n/a
subroutine 10 10 100.0
pod 1 1 100.0
total 42 42 100.0


line stmt bran cond sub pod time code
1             package Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF;
2              
3 35     35   344986 use base qw(Wikibase::Datatype::Reference);
  35         112  
  35         13960  
4 35     35   258 use strict;
  35         123  
  35         647  
5 35     35   198 use warnings;
  35         94  
  35         1026  
6              
7 35     35   16249 use Test::Shared::Fixture::Wikibase::Datatype::Snak::Wikidata::Retrieved::Fixture1;
  35         152  
  35         1302  
8 35     35   17094 use Test::Shared::Fixture::Wikibase::Datatype::Snak::Wikidata::StatedIn::VIAF;
  35         115  
  35         1078  
9 35     35   274 use Wikibase::Datatype::Snak;
  35         104  
  35         628  
10 35     35   189 use Wikibase::Datatype::Value::Item;
  35         103  
  35         659  
11 35     35   6805 use Wikibase::Datatype::Value::String;
  35         102  
  35         900  
12 35     35   212 use Wikibase::Datatype::Value::Time;
  35         90  
  35         4785  
13              
14             our $VERSION = 0.30;
15              
16             sub new {
17 22     22 1 223 my $class = shift;
18              
19 22         214 my @params = (
20             'snaks' => [
21             # stated in (P248) Virtual International Authority File (Q53919)
22             Test::Shared::Fixture::Wikibase::Datatype::Snak::Wikidata::StatedIn::VIAF->new,
23              
24             # VIAF ID (P214) 113230702
25             Wikibase::Datatype::Snak->new(
26             'datatype' => 'external-id',
27             'datavalue' => Wikibase::Datatype::Value::String->new(
28             'value' => '113230702',
29             ),
30             'property' => 'P214',
31             ),
32              
33             # retrieved (P813) 7 December 2013
34             Test::Shared::Fixture::Wikibase::Datatype::Snak::Wikidata::Retrieved::Fixture1->new,
35             ],
36             );
37              
38 22         275 my $self = $class->SUPER::new(@params);
39              
40 22         261 return $self;
41             }
42              
43             1;
44              
45             __END__
46              
47             =pod
48              
49             =encoding utf8
50              
51             =head1 NAME
52              
53             Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF - Test instance for Wikidata reference.
54              
55             =head1 SYNOPSIS
56              
57             use Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF;
58              
59             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF->new;
60             my $snaks_ar = $obj->snaks;
61              
62             =head1 METHODS
63              
64             =head2 C<new>
65              
66             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF->new;
67              
68             Constructor.
69              
70             Returns instance of object.
71              
72             =head2 C<snaks>
73              
74             my $snaks_ar = $obj->snaks;
75              
76             Get snaks.
77              
78             Returns reference to array of Wikibase::Datatype::Snak instances.
79              
80             =head1 EXAMPLE
81              
82             =for comment filename=fixture_create_and_print_reference_wd_viaf.pl
83              
84             use strict;
85             use warnings;
86              
87             use Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF;
88             use Wikibase::Datatype::Print::Reference;
89              
90             # Object.
91             my $obj = Test::Shared::Fixture::Wikibase::Datatype::Reference::Wikidata::VIAF->new;
92              
93             # Print out.
94             print scalar Wikibase::Datatype::Print::Reference::print($obj);
95              
96             # Output:
97             # {
98             # P248: Q53919
99             # P214: 113230702
100             # P813: 07 December 2013 (Q1985727)
101             # }
102              
103             =head1 DEPENDENCIES
104              
105             L<Test::Shared::Fixture::Wikibase::Datatype::Snak::Wikidata::Retrieved::Fixture1>,
106             L<Test::Shared::Fixture::Wikibase::Datatype::Snak::Wikidata::StatedIn::VIAF>,
107             L<Wikibase::Datatype::Reference>,
108             L<Wikibase::Datatype::Snak>,
109             L<Wikibase::Datatype::Value::Item>,
110             L<Wikibase::Datatype::Value::String>,
111             L<Wikibase::Datatype::Value::Time>.
112              
113             =head1 SEE ALSO
114              
115             =over
116              
117             =item L<Wikibase::Datatype>
118              
119             Wikibase datatypes.
120              
121             =item L<Wikibase::Datatype::Reference>
122              
123             Wikibase reference value datatype.
124              
125             =back
126              
127             =head1 REPOSITORY
128              
129             L<https://github.com/michal-josef-spacek/Wikibase-Datatype>
130              
131             =head1 AUTHOR
132              
133             Michal Josef Špaček L<mailto:skim@cpan.org>
134              
135             L<http://skim.cz>
136              
137             =head1 LICENSE AND COPYRIGHT
138              
139             © 2020-2023 Michal Josef Špaček
140              
141             BSD 2-Clause License
142              
143             =head1 VERSION
144              
145             0.30
146              
147             =cut