Skip to content

Commit 2cfcaee

Browse files
authored
Merge pull request #703 from wmde/add-count-test
Added missing SiteLinkList::count tests
2 parents 9b40081 + 1c61a10 commit 2cfcaee

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

tests/unit/SiteLinkListTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,4 +322,17 @@ public function testGivenSiteLinkWithExistingId_setNewSiteLinkReplacesIt() {
322322
$this->assertEquals( $expectedList, $list );
323323
}
324324

325+
public function testEmptyListHasCountZero() {
326+
$this->assertSame( 0, ( new SiteLinkList() )->count() );
327+
}
328+
329+
public function testListWithElementsHasCorrectCount() {
330+
$list = new SiteLinkList();
331+
$list->addNewSiteLink( 'enwiki', 'foo' );
332+
$list->addNewSiteLink( 'dewiki', 'bar' );
333+
$list->setNewSiteLink( 'nlwiki', 'baz' );
334+
335+
$this->assertSame( 3, $list->count() );
336+
}
337+
325338
}

0 commit comments

Comments
 (0)