Skip to content

Commit 16b88e4

Browse files
committed
Merge pull request #558 from wmde/claimsInTests
Replace Claims with ArrayObject in tests
2 parents a92e6ae + f6bc171 commit 16b88e4

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

tests/unit/ByPropertyIdArrayTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Wikibase\DataModel\Tests;
44

5+
use ArrayObject;
56
use DataValues\StringValue;
67
use ReflectionClass;
78
use ReflectionMethod;
89
use Wikibase\DataModel\ByPropertyIdArray;
9-
use Wikibase\DataModel\Claim\Claims;
1010
use Wikibase\DataModel\Entity\PropertyId;
1111
use Wikibase\DataModel\Snak\PropertyNoValueSnak;
1212
use Wikibase\DataModel\Snak\PropertySomeValueSnak;
@@ -33,10 +33,10 @@ public function testArrayObjectNotConstructedFromObject() {
3333
$statement2 = new Statement( new PropertyNoValueSnak( 2 ) );
3434
$statement2->setGuid( '2' );
3535

36-
$claims = new Claims();
37-
$claims->append( $statement1 );
36+
$object = new ArrayObject();
37+
$object->append( $statement1 );
3838

39-
$byPropertyIdArray = new ByPropertyIdArray( $claims );
39+
$byPropertyIdArray = new ByPropertyIdArray( $object );
4040
// According to the documentation append() "cannot be called when the ArrayObject was
4141
// constructed from an object." This test makes sure it was not constructed from an object.
4242
$byPropertyIdArray->append( $statement2 );

tests/unit/Statement/StatementListTest.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Wikibase\DataModel\Tests\Statement;
44

5+
use ArrayObject;
56
use DataValues\StringValue;
6-
use Wikibase\DataModel\Claim\Claims;
77
use Wikibase\DataModel\Entity\PropertyId;
88
use Wikibase\DataModel\Reference;
99
use Wikibase\DataModel\ReferenceList;
@@ -280,15 +280,14 @@ public function testGivenNullGuid_allStatementsWithNoGuidAreRemoved() {
280280
$this->assertEquals( new StatementList( $statement1 ), $list );
281281
}
282282

283-
public function testCanConstructWithClaimsObjectContainingOnlyStatements() {
283+
public function testCanConstructWithTraversableContainingOnlyStatements() {
284284
$statementArray = array(
285285
$this->getStatementWithSnak( 1, 'foo' ),
286286
$this->getStatementWithSnak( 2, 'bar' ),
287287
);
288288

289-
$claimsObject = new Claims( $statementArray );
290-
291-
$list = new StatementList( $claimsObject );
289+
$object = new ArrayObject( $statementArray );
290+
$list = new StatementList( $object );
292291

293292
$this->assertEquals(
294293
$statementArray,

0 commit comments

Comments
 (0)