jenkins-bot has submitted this change and it was merged.
Change subject: Remove EntityPerPageBuilderTest::itemSupportsRedirect
......................................................................
Remove EntityPerPageBuilderTest::itemSupportsRedirect
We support redirects everywhere, so no need to check
this.
We already have many places in the code that assume this.
Change-Id: I551df05ab3435e1cb6427ef900c62fdbcca82adf
---
M repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
1 file changed, 10 insertions(+), 20 deletions(-)
Approvals:
Thiemo Mättig (WMDE): Looks good to me, approved
jenkins-bot: Verified
diff --git a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
index 73b0dde..15ca610 100644
--- a/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
+++ b/repo/tests/phpunit/includes/store/sql/EntityPerPageBuilderTest.php
@@ -83,14 +83,6 @@
}
/**
- * @return bool
- */
- private function itemSupportsRedirect() {
- $handler = ContentHandler::getForModelID(
CONTENT_MODEL_WIKIBASE_ITEM );
- return $handler->supportsRedirects();
- }
-
- /**
* @return Item[]
*/
private function addItems() {
@@ -113,20 +105,18 @@
$items[] = $rev->getEntity();
}
- if ( $this->itemSupportsRedirect() ) {
- // add another berlin (so we have a valid id), then
turn it into a redirect
- $item = new Item();
- $item->setLabel( 'en', $prefix . 'Berlin2' );
- $rev = $store->saveEntity( $item, "added an item",
$user, EDIT_NEW );
- $items[] = $rev->getEntity();
+ // add another berlin (so we have a valid id), then turn it
into a redirect
+ $item = new Item();
+ $item->setLabel( 'en', $prefix . 'Berlin2' );
+ $rev = $store->saveEntity( $item, "added an item", $user,
EDIT_NEW );
+ $items[] = $rev->getEntity();
- $items = array_reverse( $items );
- $berlin2 = $items[0]->getId();
- $berlin1 = $items[1]->getId();
- $redirect = new EntityRedirect( $berlin2, $berlin1 );
+ $items = array_reverse( $items );
+ $berlin2 = $items[0]->getId();
+ $berlin1 = $items[1]->getId();
+ $redirect = new EntityRedirect( $berlin2, $berlin1 );
- $store->saveRedirect( $redirect, "created redirect",
$user, EDIT_UPDATE );
- }
+ $store->saveRedirect( $redirect, "created redirect", $user,
EDIT_UPDATE );
return $items;
}
--
To view, visit https://gerrit.wikimedia.org/r/264421
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I551df05ab3435e1cb6427ef900c62fdbcca82adf
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hoo man <[email protected]>
Gerrit-Reviewer: Aude <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits