1 | <?php |
||
20 | class ItemIdTest extends PHPUnit_Framework_TestCase { |
||
21 | |||
22 | /** |
||
23 | * @dataProvider idSerializationProvider |
||
24 | */ |
||
25 | public function testCanConstructId( $idSerialization, $normalizedIdSerialization ) { |
||
26 | $id = new ItemId( $idSerialization ); |
||
27 | |||
28 | $this->assertEquals( |
||
29 | $normalizedIdSerialization, |
||
30 | $id->getSerialization() |
||
31 | ); |
||
32 | } |
||
33 | |||
34 | public function idSerializationProvider() { |
||
35 | return [ |
||
36 | [ 'q1', 'Q1' ], |
||
37 | [ 'q100', 'Q100' ], |
||
38 | [ 'q1337', 'Q1337' ], |
||
39 | [ 'q31337', 'Q31337' ], |
||
40 | [ 'Q31337', 'Q31337' ], |
||
41 | [ 'Q42', 'Q42' ], |
||
42 | [ ':Q42', 'Q42' ], |
||
43 | [ 'foo:Q42', 'foo:Q42' ], |
||
44 | [ 'foo:bar:q42', 'foo:bar:Q42' ], |
||
45 | [ 'Q2147483647', 'Q2147483647' ], |
||
46 | ]; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @dataProvider invalidIdSerializationProvider |
||
51 | */ |
||
52 | public function testCannotConstructWithInvalidSerialization( $invalidSerialization ) { |
||
56 | |||
57 | public function invalidIdSerializationProvider() { |
||
78 | |||
79 | public function testGetNumericId() { |
||
83 | |||
84 | public function testGetEntityType() { |
||
88 | |||
89 | public function testSerialize() { |
||
93 | |||
94 | /** |
||
95 | * @dataProvider serializationProvider |
||
96 | */ |
||
97 | public function testUnserialize( $json, $expected ) { |
||
102 | |||
103 | public function serializationProvider() { |
||
116 | |||
117 | /** |
||
118 | * @dataProvider numericIdProvider |
||
119 | */ |
||
120 | public function testNewFromNumber( $number ) { |
||
124 | |||
125 | public function numericIdProvider() { |
||
135 | |||
136 | /** |
||
137 | * @dataProvider invalidNumericIdProvider |
||
138 | */ |
||
139 | public function testNewFromNumberWithInvalidNumericId( $number ) { |
||
143 | |||
144 | public function invalidNumericIdProvider() { |
||
153 | |||
154 | public function testGetNumericIdThrowsExceptionOnForeignIds() { |
||
158 | |||
159 | } |
||
160 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.