Adrian Lang has uploaded a new change for review. https://gerrit.wikimedia.org/r/192521
Change subject: Add test for T90268 ...................................................................... Add test for T90268 Change-Id: I81d3f6ef15a4ea0b107f9625a99592c5cb7062ad --- M repo/tests/phpunit/includes/View/EntityViewPlaceholderExpanderTest.php 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/21/192521/1 diff --git a/repo/tests/phpunit/includes/View/EntityViewPlaceholderExpanderTest.php b/repo/tests/phpunit/includes/View/EntityViewPlaceholderExpanderTest.php index 8fa8d4a..da043c2 100644 --- a/repo/tests/phpunit/includes/View/EntityViewPlaceholderExpanderTest.php +++ b/repo/tests/phpunit/includes/View/EntityViewPlaceholderExpanderTest.php @@ -105,6 +105,18 @@ return $entityLookup; } + /** + * @return EntityRevisionLookup + */ + private function getNullReturningEntityRevisionLookup() { + $entityLookup = $this->getMock( 'Wikibase\Lib\Store\EntityRevisionLookup' ); + $entityLookup->expects( $this->any() ) + ->method( 'getEntityRevision' ) + ->will( $this->returnValue( null ) ); + + return $entityLookup; + } + private function getItem() { $item = new Item( new ItemId( 'Q23' ) ); @@ -170,6 +182,17 @@ $this->assertEquals( '', $html ); } + public function testRenderTermBoxForNonEntityRevision() { + $item = $this->getItem(); + $itemId = $item->getId(); + $entityRevisionLookup = $this->getNullReturningEntityRevisionLookup(); + + $expander = $this->newExpander( $this->newUser(), $entityRevisionLookup, $itemId ); + + $html = $expander->renderTermBox( $itemId, 1 ); + $this->assertEquals( '', $html ); + } + public function testGetExtraUserLanguages() { $item = $this->getItem(); $itemId = $item->getId(); -- To view, visit https://gerrit.wikimedia.org/r/192521 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I81d3f6ef15a4ea0b107f9625a99592c5cb7062ad Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Adrian Lang <adrian.he...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits