Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/99557
Change subject: Add test for EntityView::getHtmlForEditSection
......................................................................
Add test for EntityView::getHtmlForEditSection
Change-Id: I99f15738a90a02c9fe3431c7bbb38645c87b1460
---
M repo/tests/phpunit/includes/EntityViewTest.php
1 file changed, 13 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/57/99557/1
diff --git a/repo/tests/phpunit/includes/EntityViewTest.php
b/repo/tests/phpunit/includes/EntityViewTest.php
index e0e35d9..16d15c5 100644
--- a/repo/tests/phpunit/includes/EntityViewTest.php
+++ b/repo/tests/phpunit/includes/EntityViewTest.php
@@ -68,10 +68,6 @@
*/
protected function newSnakFormatterMock() {
$snakFormatter = $this->getMock( 'Wikibase\Lib\SnakFormatter' );
-
- $snakFormatter->expects( $this->any() )->method( 'formatSnak' )
- ->will( $this->returnValue( '(value)' ) );
-
$snakFormatter->expects( $this->any() )->method( 'getFormat' )
->will( $this->returnValue(
SnakFormatter::FORMAT_HTML_WIDGET ) );
@@ -147,6 +143,18 @@
$revision = new EntityRevision( $entity, $revId, $timestamp );
return $revision;
+ }
+
+ public function testGetHtmlForEditSection() {
+ $entityView = $this->newEntityView( Item::ENTITY_TYPE );
+
+ $editSectionHtml = $entityView->getHtmlForEditSection( '',
'blink', 'edit', true );
+ $matcher = array(
+ 'tag' => 'blink',
+ 'class' => 'wb-editsection'
+ );
+
+ $this->assertTag( $matcher, $editSectionHtml );
}
/**
@@ -372,7 +380,7 @@
// test whether we get the right EntityView from an
EntityRevision
$view = EntityView::newForEntityType(
$entityRevision->getEntity()->getType(),
- $this->newSnakFormatterMock(),
+ $this->newSnakFormatterMock(),
$dataTypeLookup,
$entityInfoBuilder,
$entityTitleLookup
--
To view, visit https://gerrit.wikimedia.org/r/99557
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I99f15738a90a02c9fe3431c7bbb38645c87b1460
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits