1 | <?php |
||
17 | class PropertyRegistryTest extends \PHPUnit_Framework_TestCase { |
||
18 | |||
19 | public function testCanConstruct() { |
||
20 | |||
21 | $this->assertInstanceOf( |
||
22 | '\SCI\PropertyRegistry', |
||
23 | new PropertyRegistry() |
||
24 | ); |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @dataProvider propertyIdProvider |
||
29 | */ |
||
30 | public function testRegisterTo( $id, $label ) { |
||
31 | |||
32 | $corePropertyRegistry = CorePropertyRegistry::getInstance(); |
||
33 | |||
34 | $instance = new PropertyRegistry(); |
||
35 | $instance->registerTo( $corePropertyRegistry ); |
||
36 | |||
37 | $this->assertNotEmpty( |
||
38 | $corePropertyRegistry->findPropertyLabelById ( $id ) |
||
39 | ); |
||
40 | |||
41 | $this->assertSame( |
||
42 | $label, |
||
43 | $corePropertyRegistry->findPropertyLabelById ( $id ) |
||
44 | ); |
||
45 | } |
||
46 | |||
47 | public function propertyIdProvider() { |
||
48 | |||
49 | $provider[] = [ |
||
50 | PropertyRegistry::SCI_DOI, |
||
51 | 'DOI' |
||
52 | ]; |
||
53 | |||
54 | $provider[] = [ |
||
55 | PropertyRegistry::SCI_PMCID, |
||
56 | 'PMCID' |
||
57 | ]; |
||
58 | |||
59 | $provider[] = [ |
||
60 | PropertyRegistry::SCI_CITE_KEY, |
||
61 | 'Citation key' |
||
62 | ]; |
||
63 | |||
64 | $provider[] = [ |
||
65 | PropertyRegistry::SCI_CITE_REFERENCE, |
||
66 | 'Citation reference' |
||
67 | ]; |
||
68 | |||
69 | $provider[] = [ |
||
70 | PropertyRegistry::SCI_CITE_TEXT, |
||
71 | 'Citation text' |
||
72 | ]; |
||
73 | |||
74 | $provider[] = [ |
||
75 | PropertyRegistry::SCI_CITE, |
||
76 | 'Citation resource' |
||
77 | ]; |
||
78 | |||
79 | return $provider; |
||
80 | } |
||
81 | |||
82 | } |
||
83 |