|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Wikibase\DataModel\Tests\Statement; |
|
4
|
|
|
|
|
5
|
|
|
use DataValues\StringValue; |
|
6
|
|
|
use InvalidArgumentException; |
|
7
|
|
|
use Wikibase\DataModel\Entity\PropertyId; |
|
8
|
|
|
use Wikibase\DataModel\Reference; |
|
9
|
|
|
use Wikibase\DataModel\ReferenceList; |
|
10
|
|
|
use Wikibase\DataModel\Snak\PropertyNoValueSnak; |
|
11
|
|
|
use Wikibase\DataModel\Snak\PropertySomeValueSnak; |
|
12
|
|
|
use Wikibase\DataModel\Snak\PropertyValueSnak; |
|
13
|
|
|
use Wikibase\DataModel\Snak\Snak; |
|
14
|
|
|
use Wikibase\DataModel\Snak\SnakList; |
|
15
|
|
|
use Wikibase\DataModel\Statement\Statement; |
|
16
|
|
|
use Wikibase\DataModel\Tests\Facet\FacetContainerContractTester; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* @covers Wikibase\DataModel\Statement\Statement |
|
20
|
|
|
* |
|
21
|
|
|
* @group Wikibase |
|
22
|
|
|
* @group WikibaseDataModel |
|
23
|
|
|
* @group WikibaseStatement |
|
24
|
|
|
* |
|
25
|
|
|
* @licence GNU GPL v2+ |
|
26
|
|
|
* @author Jeroen De Dauw < [email protected] > |
|
27
|
|
|
*/ |
|
28
|
|
|
class StatementTest extends \PHPUnit_Framework_TestCase { |
|
29
|
|
|
|
|
30
|
|
|
public function testMinimalConstructor() { |
|
31
|
|
|
$mainSnak = new PropertyNoValueSnak( 1 ); |
|
32
|
|
|
$statement = new Statement( $mainSnak ); |
|
33
|
|
|
$this->assertTrue( $mainSnak->equals( $statement->getMainSnak() ) ); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @dataProvider validConstructorArgumentsProvider |
|
38
|
|
|
*/ |
|
39
|
|
|
public function testConstructorWithValidArguments( |
|
40
|
|
|
Snak $mainSnak, |
|
41
|
|
|
SnakList $qualifiers = null, |
|
42
|
|
|
ReferenceList $references = null, |
|
43
|
|
|
$guid |
|
44
|
|
|
) { |
|
45
|
|
|
$statement = new Statement( $mainSnak, $qualifiers, $references, $guid ); |
|
46
|
|
|
$this->assertTrue( $statement->getMainSnak()->equals( $mainSnak ) ); |
|
47
|
|
|
$this->assertTrue( $statement->getQualifiers()->equals( $qualifiers ?: new SnakList() ) ); |
|
48
|
|
|
$this->assertTrue( $statement->getReferences()->equals( $references ?: new ReferenceList() ) ); |
|
49
|
|
|
$this->assertSame( $guid, $statement->getGuid() ); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function validConstructorArgumentsProvider() { |
|
53
|
|
|
$snak = new PropertyNoValueSnak( 1 ); |
|
54
|
|
|
$qualifiers = new SnakList( array( $snak ) ); |
|
55
|
|
|
$references = new ReferenceList( array( new Reference( array( $snak ) ) ) ); |
|
56
|
|
|
|
|
57
|
|
|
return array( |
|
58
|
|
|
array( $snak, null, null, null ), |
|
59
|
|
|
array( $snak, null, null, 'guid' ), |
|
60
|
|
|
array( $snak, $qualifiers, $references, 'guid' ), |
|
61
|
|
|
); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* @dataProvider instanceProvider |
|
66
|
|
|
*/ |
|
67
|
|
|
public function testSetGuid( Statement $statement ) { |
|
68
|
|
|
$statement->setGuid( 'foo-bar-baz' ); |
|
69
|
|
|
$this->assertEquals( 'foo-bar-baz', $statement->getGuid() ); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @dataProvider instanceProvider |
|
74
|
|
|
*/ |
|
75
|
|
|
public function testGetGuid( Statement $statement ) { |
|
76
|
|
|
$guid = $statement->getGuid(); |
|
77
|
|
|
$this->assertTrue( $guid === null || is_string( $guid ) ); |
|
78
|
|
|
$this->assertEquals( $guid, $statement->getGuid() ); |
|
79
|
|
|
|
|
80
|
|
|
$statement->setGuid( 'foobar' ); |
|
81
|
|
|
$this->assertEquals( 'foobar', $statement->getGuid() ); |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function testSetAndGetMainSnak() { |
|
85
|
|
|
$mainSnak = new PropertyNoValueSnak( new PropertyId( 'P42' ) ); |
|
86
|
|
|
$statement = new Statement( $mainSnak ); |
|
87
|
|
|
$this->assertSame( $mainSnak, $statement->getMainSnak() ); |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
public function testSetAndGetQualifiers() { |
|
91
|
|
|
$qualifiers = new SnakList( array( |
|
92
|
|
|
new PropertyValueSnak( new PropertyId( 'P42' ), new StringValue( 'a' ) ) |
|
93
|
|
|
) ); |
|
94
|
|
|
|
|
95
|
|
|
$statement = new Statement( |
|
96
|
|
|
new PropertyNoValueSnak( new PropertyId( 'P42' ) ), |
|
97
|
|
|
$qualifiers |
|
98
|
|
|
); |
|
99
|
|
|
|
|
100
|
|
|
$this->assertSame( $qualifiers, $statement->getQualifiers() ); |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @dataProvider instanceProvider |
|
105
|
|
|
*/ |
|
106
|
|
|
public function testSerialize( Statement $statement ) { |
|
107
|
|
|
$copy = unserialize( serialize( $statement ) ); |
|
108
|
|
|
|
|
109
|
|
|
$this->assertEquals( $statement->getHash(), $copy->getHash(), 'Serialization roundtrip should not affect hash' ); |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
public function testGuidDoesNotAffectHash() { |
|
113
|
|
|
$statement0 = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
114
|
|
|
$statement0->setGuid( 'statement0' ); |
|
115
|
|
|
|
|
116
|
|
|
$statement1 = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
117
|
|
|
$statement1->setGuid( 'statement1' ); |
|
118
|
|
|
|
|
119
|
|
|
$this->assertEquals( $statement0->getHash(), $statement1->getHash() ); |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
|
|
/** |
|
123
|
|
|
* @dataProvider invalidGuidProvider |
|
124
|
|
|
* @expectedException InvalidArgumentException |
|
125
|
|
|
*/ |
|
126
|
|
|
public function testGivenInvalidGuid_constructorThrowsException( $guid ) { |
|
127
|
|
|
new Statement( new PropertyNoValueSnak( 1 ), null, null, $guid ); |
|
128
|
|
|
} |
|
129
|
|
|
|
|
130
|
|
|
/** |
|
131
|
|
|
* @dataProvider invalidGuidProvider |
|
132
|
|
|
* @expectedException InvalidArgumentException |
|
133
|
|
|
*/ |
|
134
|
|
|
public function testGivenInvalidGuid_setGuidThrowsException( $guid ) { |
|
135
|
|
|
$statement = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
136
|
|
|
$statement->setGuid( $guid ); |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
public function invalidGuidProvider() { |
|
140
|
|
|
$snak = new PropertyNoValueSnak( 1 ); |
|
141
|
|
|
|
|
142
|
|
|
return array( |
|
143
|
|
|
array( false ), |
|
144
|
|
|
array( 1 ), |
|
145
|
|
|
array( $snak ), |
|
146
|
|
|
array( new Statement( $snak ) ), |
|
147
|
|
|
); |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
public function instanceProvider() { |
|
151
|
|
|
$instances = array(); |
|
152
|
|
|
|
|
153
|
|
|
$propertyId = new PropertyId( 'P42' ); |
|
154
|
|
|
$baseInstance = new Statement( new PropertyNoValueSnak( $propertyId ) ); |
|
155
|
|
|
|
|
156
|
|
|
$instances[] = $baseInstance; |
|
157
|
|
|
|
|
158
|
|
|
$instance = clone $baseInstance; |
|
159
|
|
|
$instance->setRank( Statement::RANK_PREFERRED ); |
|
160
|
|
|
|
|
161
|
|
|
$instances[] = $instance; |
|
162
|
|
|
|
|
163
|
|
|
$newInstance = clone $instance; |
|
164
|
|
|
|
|
165
|
|
|
$instances[] = $newInstance; |
|
166
|
|
|
|
|
167
|
|
|
$instance = clone $baseInstance; |
|
168
|
|
|
|
|
169
|
|
|
$instance->setReferences( new ReferenceList( array( |
|
170
|
|
|
new Reference( array( |
|
171
|
|
|
new PropertyValueSnak( new PropertyId( 'P1' ), new StringValue( 'a' ) ) |
|
172
|
|
|
) ) |
|
173
|
|
|
) ) ); |
|
174
|
|
|
|
|
175
|
|
|
$instances[] = $instance; |
|
176
|
|
|
|
|
177
|
|
|
$argLists = array(); |
|
178
|
|
|
|
|
179
|
|
|
foreach ( $instances as $instance ) { |
|
180
|
|
|
$argLists[] = array( $instance ); |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
return $argLists; |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
/** |
|
187
|
|
|
* @dataProvider instanceProvider |
|
188
|
|
|
*/ |
|
189
|
|
|
public function testGetReferences( Statement $statement ) { |
|
190
|
|
|
$this->assertInstanceOf( 'Wikibase\DataModel\ReferenceList', $statement->getReferences() ); |
|
191
|
|
|
} |
|
192
|
|
|
|
|
193
|
|
|
/** |
|
194
|
|
|
* @dataProvider instanceProvider |
|
195
|
|
|
*/ |
|
196
|
|
|
public function testSetReferences( Statement $statement ) { |
|
197
|
|
|
$references = new ReferenceList( array( |
|
198
|
|
|
new Reference( array( |
|
199
|
|
|
new PropertyValueSnak( new PropertyId( 'P1' ), new StringValue( 'a' ) ), |
|
200
|
|
|
) ) |
|
201
|
|
|
) ); |
|
202
|
|
|
|
|
203
|
|
|
$statement->setReferences( $references ); |
|
204
|
|
|
|
|
205
|
|
|
$this->assertEquals( $references, $statement->getReferences() ); |
|
206
|
|
|
} |
|
207
|
|
|
|
|
208
|
|
|
/** |
|
209
|
|
|
* @dataProvider instanceProvider |
|
210
|
|
|
*/ |
|
211
|
|
|
public function testAddNewReferenceWithVariableArgumentsSyntax( Statement $statement ) { |
|
212
|
|
|
$snak1 = new PropertyNoValueSnak( 256 ); |
|
213
|
|
|
$snak2 = new PropertySomeValueSnak( 42 ); |
|
214
|
|
|
$statement->addNewReference( $snak1, $snak2 ); |
|
215
|
|
|
|
|
216
|
|
|
$expectedSnaks = array( $snak1, $snak2 ); |
|
217
|
|
|
$this->assertTrue( $statement->getReferences()->hasReference( new Reference( $expectedSnaks ) ) ); |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* @dataProvider instanceProvider |
|
222
|
|
|
*/ |
|
223
|
|
|
public function testAddNewReferenceWithAnArrayOfSnaks( Statement $statement ) { |
|
224
|
|
|
$snaks = array( |
|
225
|
|
|
new PropertyNoValueSnak( 256 ), |
|
226
|
|
|
new PropertySomeValueSnak( 42 ), |
|
227
|
|
|
); |
|
228
|
|
|
$statement->addNewReference( $snaks ); |
|
229
|
|
|
|
|
230
|
|
|
$this->assertTrue( $statement->getReferences()->hasReference( new Reference( $snaks ) ) ); |
|
231
|
|
|
} |
|
232
|
|
|
|
|
233
|
|
|
/** |
|
234
|
|
|
* @dataProvider instanceProvider |
|
235
|
|
|
*/ |
|
236
|
|
|
public function testGetRank( Statement $statement ) { |
|
237
|
|
|
$rank = $statement->getRank(); |
|
238
|
|
|
$this->assertInternalType( 'integer', $rank ); |
|
239
|
|
|
|
|
240
|
|
|
$ranks = array( Statement::RANK_DEPRECATED, Statement::RANK_NORMAL, Statement::RANK_PREFERRED ); |
|
241
|
|
|
$this->assertTrue( in_array( $rank, $ranks ), true ); |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* @dataProvider instanceProvider |
|
246
|
|
|
*/ |
|
247
|
|
|
public function testSetRank( Statement $statement ) { |
|
248
|
|
|
$statement->setRank( Statement::RANK_DEPRECATED ); |
|
249
|
|
|
$this->assertEquals( Statement::RANK_DEPRECATED, $statement->getRank() ); |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* @dataProvider instanceProvider |
|
254
|
|
|
*/ |
|
255
|
|
|
public function testSetInvalidRank( Statement $statement ) { |
|
256
|
|
|
$this->setExpectedException( 'InvalidArgumentException' ); |
|
257
|
|
|
$statement->setRank( 9001 ); |
|
258
|
|
|
} |
|
259
|
|
|
|
|
260
|
|
|
/** |
|
261
|
|
|
* @dataProvider instanceProvider |
|
262
|
|
|
*/ |
|
263
|
|
|
public function testGetPropertyId( Statement $statement ) { |
|
264
|
|
|
$this->assertEquals( |
|
265
|
|
|
$statement->getMainSnak()->getPropertyId(), |
|
266
|
|
|
$statement->getPropertyId() |
|
267
|
|
|
); |
|
268
|
|
|
} |
|
269
|
|
|
|
|
270
|
|
|
/** |
|
271
|
|
|
* @dataProvider instanceProvider |
|
272
|
|
|
*/ |
|
273
|
|
|
public function testGetAllSnaks( Statement $statement ) { |
|
274
|
|
|
$snaks = $statement->getAllSnaks(); |
|
275
|
|
|
|
|
276
|
|
|
$c = count( $statement->getQualifiers() ) + 1; |
|
277
|
|
|
|
|
278
|
|
|
/* @var Reference $reference */ |
|
279
|
|
|
foreach ( $statement->getReferences() as $reference ) { |
|
280
|
|
|
$c += count( $reference->getSnaks() ); |
|
281
|
|
|
} |
|
282
|
|
|
|
|
283
|
|
|
$this->assertGreaterThanOrEqual( $c, count( $snaks ), 'At least one snak per Qualifier and Reference' ); |
|
284
|
|
|
} |
|
285
|
|
|
|
|
286
|
|
|
public function testGivenNonStatement_equalsReturnsFalse() { |
|
287
|
|
|
$statement = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
288
|
|
|
|
|
289
|
|
|
$this->assertFalse( $statement->equals( null ) ); |
|
290
|
|
|
$this->assertFalse( $statement->equals( 42 ) ); |
|
291
|
|
|
$this->assertFalse( $statement->equals( new \stdClass() ) ); |
|
292
|
|
|
} |
|
293
|
|
|
|
|
294
|
|
|
public function testGivenSameStatement_equalsReturnsTrue() { |
|
295
|
|
|
$statement = new Statement( |
|
296
|
|
|
new PropertyNoValueSnak( 42 ), |
|
297
|
|
|
new SnakList( array( |
|
298
|
|
|
new PropertyNoValueSnak( 1337 ), |
|
299
|
|
|
) ), |
|
300
|
|
|
new ReferenceList( array( |
|
301
|
|
|
new Reference( array( new PropertyNoValueSnak( 1337 ) ) ), |
|
302
|
|
|
) ) |
|
303
|
|
|
); |
|
304
|
|
|
|
|
305
|
|
|
$statement->setGuid( 'kittens' ); |
|
306
|
|
|
|
|
307
|
|
|
$this->assertTrue( $statement->equals( $statement ) ); |
|
308
|
|
|
$this->assertTrue( $statement->equals( clone $statement ) ); |
|
309
|
|
|
} |
|
310
|
|
|
|
|
311
|
|
|
public function testGivenStatementWithDifferentProperty_equalsReturnsFalse() { |
|
312
|
|
|
$statement = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
313
|
|
|
$this->assertFalse( $statement->equals( new Statement( new PropertyNoValueSnak( 43 ) ) ) ); |
|
314
|
|
|
} |
|
315
|
|
|
|
|
316
|
|
|
public function testGivenStatementWithDifferentSnakType_equalsReturnsFalse() { |
|
317
|
|
|
$statement = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
318
|
|
|
$this->assertFalse( $statement->equals( new Statement( new PropertySomeValueSnak( 42 ) ) ) ); |
|
319
|
|
|
} |
|
320
|
|
|
|
|
321
|
|
|
public function testStatementClaimWithDifferentQualifiers_equalsReturnsFalse() { |
|
322
|
|
|
$statement = new Statement( |
|
323
|
|
|
new PropertyNoValueSnak( 42 ), |
|
324
|
|
|
new SnakList( array( |
|
325
|
|
|
new PropertyNoValueSnak( 1337 ), |
|
326
|
|
|
) ) |
|
327
|
|
|
); |
|
328
|
|
|
|
|
329
|
|
|
$differentStatement = new Statement( |
|
330
|
|
|
new PropertyNoValueSnak( 42 ), |
|
331
|
|
|
new SnakList( array( |
|
332
|
|
|
new PropertyNoValueSnak( 32202 ), |
|
333
|
|
|
) ) |
|
334
|
|
|
); |
|
335
|
|
|
|
|
336
|
|
|
$this->assertFalse( $statement->equals( $differentStatement ) ); |
|
337
|
|
|
} |
|
338
|
|
|
|
|
339
|
|
|
public function testGivenStatementWithDifferentGuids_equalsReturnsFalse() { |
|
340
|
|
|
$statement = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
341
|
|
|
|
|
342
|
|
|
$differentStatement = new Statement( new PropertyNoValueSnak( 42 ) ); |
|
343
|
|
|
$differentStatement->setGuid( 'kittens' ); |
|
344
|
|
|
|
|
345
|
|
|
$this->assertFalse( $statement->equals( $differentStatement ) ); |
|
346
|
|
|
} |
|
347
|
|
|
|
|
348
|
|
|
public function testStatementClaimWithDifferentReferences_equalsReturnsFalse() { |
|
349
|
|
|
$statement = new Statement( |
|
350
|
|
|
new PropertyNoValueSnak( 42 ), |
|
351
|
|
|
new SnakList(), |
|
352
|
|
|
new ReferenceList( array( |
|
353
|
|
|
new Reference( array( new PropertyNoValueSnak( 1337 ) ) ), |
|
354
|
|
|
) ) |
|
355
|
|
|
); |
|
356
|
|
|
|
|
357
|
|
|
$differentStatement = new Statement( |
|
358
|
|
|
new PropertyNoValueSnak( 42 ), |
|
359
|
|
|
new SnakList(), |
|
360
|
|
|
new ReferenceList( array( |
|
361
|
|
|
new Reference( array( new PropertyNoValueSnak( 32202 ) ) ), |
|
362
|
|
|
) ) |
|
363
|
|
|
); |
|
364
|
|
|
|
|
365
|
|
|
$this->assertFalse( $statement->equals( $differentStatement ) ); |
|
366
|
|
|
} |
|
367
|
|
|
|
|
368
|
|
|
public function testEquals() { |
|
369
|
|
|
$statement = $this->newStatement(); |
|
370
|
|
|
$target = $this->newStatement(); |
|
371
|
|
|
|
|
372
|
|
|
$this->assertTrue( $statement->equals( $target ) ); |
|
373
|
|
|
} |
|
374
|
|
|
|
|
375
|
|
|
/** |
|
376
|
|
|
* @dataProvider notEqualsProvider |
|
377
|
|
|
*/ |
|
378
|
|
|
public function testNotEquals( Statement $statement, Statement $target, $message ) { |
|
379
|
|
|
$this->assertFalse( $statement->equals( $target ), $message ); |
|
380
|
|
|
} |
|
381
|
|
|
|
|
382
|
|
|
public function notEqualsProvider() { |
|
383
|
|
|
$statement = $this->newStatement(); |
|
384
|
|
|
|
|
385
|
|
|
$statementWithoutQualifiers = $this->newStatement(); |
|
386
|
|
|
$statementWithoutQualifiers->setQualifiers( new SnakList() ); |
|
387
|
|
|
|
|
388
|
|
|
$statementWithoutReferences = $this->newStatement(); |
|
389
|
|
|
$statementWithoutReferences->setReferences( new ReferenceList() ); |
|
390
|
|
|
|
|
391
|
|
|
$statementWithPreferredRank = $this->newStatement(); |
|
392
|
|
|
$statementWithPreferredRank->setRank( Statement::RANK_PREFERRED ); |
|
393
|
|
|
|
|
394
|
|
|
$statementMainSnakNotEqual = $this->newStatement(); |
|
395
|
|
|
$statementMainSnakNotEqual->setMainSnak( new PropertyNoValueSnak( 9000 ) ); |
|
396
|
|
|
|
|
397
|
|
|
return array( |
|
398
|
|
|
array( $statement, $statementWithoutQualifiers, 'qualifiers not equal' ), |
|
399
|
|
|
array( $statement, $statementWithoutReferences, 'references not equal' ), |
|
400
|
|
|
array( $statement, $statementWithPreferredRank, 'rank not equal' ), |
|
401
|
|
|
array( $statement, $statementMainSnakNotEqual, 'main snak not equal' ) |
|
402
|
|
|
); |
|
403
|
|
|
} |
|
404
|
|
|
|
|
405
|
|
|
private function newStatement() { |
|
406
|
|
|
$qualifiers = new SnakList( array( new PropertyNoValueSnak( 23 ) ) ); |
|
407
|
|
|
|
|
408
|
|
|
$statement = new Statement( |
|
409
|
|
|
new PropertyNoValueSnak( 42 ), |
|
410
|
|
|
$qualifiers, |
|
411
|
|
|
new ReferenceList( array( |
|
412
|
|
|
new Reference( array( new PropertyNoValueSnak( 1337 ) ) ), |
|
413
|
|
|
) ) |
|
414
|
|
|
); |
|
415
|
|
|
|
|
416
|
|
|
$statement->setRank( Statement::RANK_NORMAL ); |
|
417
|
|
|
|
|
418
|
|
|
return $statement; |
|
419
|
|
|
} |
|
420
|
|
|
|
|
421
|
|
|
/** |
|
422
|
|
|
* @dataProvider instanceProvider |
|
423
|
|
|
* @param Statement $statement |
|
424
|
|
|
*/ |
|
425
|
|
|
public function testHasFacet( Statement $statement ) { |
|
426
|
|
|
$tester = new FacetContainerContractTester(); |
|
427
|
|
|
|
|
428
|
|
|
$tester->testHasFacet( $statement ); |
|
429
|
|
|
} |
|
430
|
|
|
|
|
431
|
|
|
/** |
|
432
|
|
|
* @dataProvider instanceProvider |
|
433
|
|
|
* @param Statement $statement |
|
434
|
|
|
*/ |
|
435
|
|
|
public function testListFacets( Statement $statement ) { |
|
436
|
|
|
$tester = new FacetContainerContractTester(); |
|
437
|
|
|
|
|
438
|
|
|
$tester->testListFacets( $statement ); |
|
439
|
|
|
} |
|
440
|
|
|
|
|
441
|
|
|
/** |
|
442
|
|
|
* @dataProvider instanceProvider |
|
443
|
|
|
* @param Statement $statement |
|
444
|
|
|
*/ |
|
445
|
|
|
public function testGetFacet( Statement $statement ) { |
|
446
|
|
|
$tester = new FacetContainerContractTester(); |
|
447
|
|
|
|
|
448
|
|
|
$tester->testGetFacet( $statement ); |
|
449
|
|
|
} |
|
450
|
|
|
|
|
451
|
|
|
/** |
|
452
|
|
|
* @dataProvider instanceProvider |
|
453
|
|
|
* @param Statement $statement |
|
454
|
|
|
*/ |
|
455
|
|
|
public function testAddFacet( Statement $statement ) { |
|
456
|
|
|
$tester = new FacetContainerContractTester(); |
|
457
|
|
|
|
|
458
|
|
|
$tester->testAddFacet( $statement ); |
|
459
|
|
|
} |
|
460
|
|
|
|
|
461
|
|
|
} |
|
462
|
|
|
|