Hoo man has uploaded a new change for review. https://gerrit.wikimedia.org/r/250035
Change subject: Remove WB_EXPERIMENTAL_FEATURES ...................................................................... Remove WB_EXPERIMENTAL_FEATURES We decided to no longer use that, but rather use individual feature flags per feature. This also removes handling in tests for the case that Items don't support redirects (various tests already assume that). I didn't yet remove the 'wbExperimentalFeatures' JavaScript variable (but made it false all the time). That should be another change. Change-Id: I5fd3c44cc4594f4ec2e50850803aae871d399181 --- M README.md M build/jenkins/mw-apply-wb-settings.sh M build/travis/mw-apply-wb-settings.sh M client/WikibaseClient.php D client/config/WikibaseClient.experimental.php M client/includes/WikibaseClient.php M lib/WikibaseLib.php M lib/config/WikibaseLib.default.php D lib/config/WikibaseLib.experimental.php M lib/includes/LanguageFallbackChainFactory.php M lib/tests/phpunit/LanguageFallbackChainFactoryTest.php M repo/Wikibase.php D repo/config/Wikibase.experimental.php M repo/includes/Hooks/OutputPageJsConfigHookHandler.php M repo/includes/OutputPageJsConfigBuilder.php M repo/includes/WikibaseRepo.php M repo/tests/phpunit/includes/Hooks/OutputPageJsConfigHookHandlerTest.php M repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php M repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php M repo/tests/phpunit/includes/content/EntityContentFactoryTest.php M repo/tests/phpunit/includes/content/ItemContentTest.php M repo/tests/phpunit/includes/content/ItemHandlerTest.php 22 files changed, 28 insertions(+), 256 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase refs/changes/35/250035/1 diff --git a/README.md b/README.md index 3df6872..5285c68 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,6 @@ * WikibaseLib (in the subdirectory lib) * Wikibase Client (in the subdirectory client) -In order to enable experimental features for the extensions, put the below line before the inclusion -of the extensions in your LocalSettings.php file: - -```php -define( 'WB_EXPERIMENTAL_FEATURES', true ); -``` - If you are running Wikibase with hhvm, you need to enable [zend compat](http://docs.hhvm.com/manual/en/configuration.zend.compat.php) in your php.ini: diff --git a/build/jenkins/mw-apply-wb-settings.sh b/build/jenkins/mw-apply-wb-settings.sh index 32a4e42..acee8f7 100755 --- a/build/jenkins/mw-apply-wb-settings.sh +++ b/build/jenkins/mw-apply-wb-settings.sh @@ -3,7 +3,6 @@ function usage { echo "usage: $0 -r <repo|client> -e <true|false> -b <true|false>" echo " -r specify if the settings are for repo or client" - echo " -e specify if experimental features should be on or off" echo " -b specify if the settings are for a build or not" exit 1 } @@ -12,7 +11,6 @@ do case $opt in r) REPO="$OPTARG";; - e) EXPERIMENTAL=$OPTARG;; b) BUILD=$OPTARG;; esac done @@ -51,10 +49,6 @@ fi } -function apply_experimental_settings { - echo "define( 'WB_EXPERIMENTAL_FEATURES', $EXPERIMENTAL );" >> LocalSettings.php -} - cd $WORKSPACE/src if [ "$(tail -n1 LocalSettings.php)" = "?>" ] @@ -65,8 +59,6 @@ then echo '<?php' >> LocalSettings.php fi - -apply_experimental_settings if [ "$REPO" = "repo" ] then diff --git a/build/travis/mw-apply-wb-settings.sh b/build/travis/mw-apply-wb-settings.sh index c3433af..b59aee4 100755 --- a/build/travis/mw-apply-wb-settings.sh +++ b/build/travis/mw-apply-wb-settings.sh @@ -27,7 +27,6 @@ echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php echo '$wgLanguageCode = "'$LANG'";' >> LocalSettings.php echo '$wgDebugLogFile = "mw-debug.log";' >> LocalSettings.php - echo "define( 'WB_EXPERIMENTAL_FEATURES', 1 );" >> LocalSettings.php echo 'require_once __DIR__ . "/extensions/cldr/cldr.php";' >> LocalSettings.php } diff --git a/client/WikibaseClient.php b/client/WikibaseClient.php index 88c9f1d..0c55b20 100644 --- a/client/WikibaseClient.php +++ b/client/WikibaseClient.php @@ -45,8 +45,7 @@ return; } -define( 'WBC_VERSION', '0.5 alpha' - . ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ? '/experimental' : '' ) ); +define( 'WBC_VERSION', '0.5 alpha' ); if ( version_compare( $GLOBALS['wgVersion'], '1.21c', '<' ) ) { // Needs to be 1.21c because version_compare() works in confusing ways. die( "<b>Error:</b> Wikibase requires MediaWiki 1.21 alpha or above.\n" ); @@ -189,10 +188,6 @@ require __DIR__ . '/../lib/config/WikibaseLib.default.php', require __DIR__ . '/config/WikibaseClient.default.php' ); - - if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ) { - include_once __DIR__ . '/config/WikibaseClient.experimental.php'; - } $wgRecentChangesFlags['wikibase-edit'] = array( 'letter' => 'wikibase-rc-wikibase-edit-letter', diff --git a/client/config/WikibaseClient.experimental.php b/client/config/WikibaseClient.experimental.php deleted file mode 100644 index 00f304d..0000000 --- a/client/config/WikibaseClient.experimental.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file holds registration of experimental features part of the Wikibase Client extension. - * - * This file is NOT an entry point the Wikibase Client extension. Use WikibaseClient.php. - * It should furthermore not be included from outside the extension. - * - * @since 0.4 - * @licence GNU GPL v2+ - */ - -if ( !defined( 'WBC_VERSION' ) || !defined( 'WB_EXPERIMENTAL_FEATURES' ) ) { - die( 'Not an entry point.' ); -} diff --git a/client/includes/WikibaseClient.php b/client/includes/WikibaseClient.php index be2fe95..16ea5cd 100644 --- a/client/includes/WikibaseClient.php +++ b/client/includes/WikibaseClient.php @@ -355,9 +355,7 @@ */ public function getLanguageFallbackChainFactory() { if ( $this->languageFallbackChainFactory === null ) { - $this->languageFallbackChainFactory = new LanguageFallbackChainFactory( - defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES - ); + $this->languageFallbackChainFactory = new LanguageFallbackChainFactory(); } return $this->languageFallbackChainFactory; diff --git a/lib/WikibaseLib.php b/lib/WikibaseLib.php index 938e1ab..fccd211 100644 --- a/lib/WikibaseLib.php +++ b/lib/WikibaseLib.php @@ -44,8 +44,7 @@ return 1; } -define( 'WBL_VERSION', '0.5 alpha' - . ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ? '/experimental' : '' ) ); +define( 'WBL_VERSION', '0.5 alpha' ); // This is the path to the autoloader generated by composer in case of a composer install. if ( ( !defined( 'WIKIBASE_DATAMODEL_VERSION' ) || !defined( 'Diff_VERSION' ) || !defined( 'DATAVALUES_VERSION' ) ) @@ -102,8 +101,4 @@ $wgResourceModules, include __DIR__ . '/resources/Resources.php' ); - - if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ) { - include_once __DIR__ . '/config/WikibaseLib.experimental.php'; - } } ); diff --git a/lib/config/WikibaseLib.default.php b/lib/config/WikibaseLib.default.php index 47ec7ca..7ad21d7 100644 --- a/lib/config/WikibaseLib.default.php +++ b/lib/config/WikibaseLib.default.php @@ -73,13 +73,4 @@ ) ); -// experimental stuff -if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ) { - // experimental data types - $wgWBLibDefaultSettings['dataTypes'] = array_merge( - $wgWBLibDefaultSettings['dataTypes'], - array() //'multilingual-text' - ); -} - return $wgWBLibDefaultSettings; diff --git a/lib/config/WikibaseLib.experimental.php b/lib/config/WikibaseLib.experimental.php deleted file mode 100644 index bca2708..0000000 --- a/lib/config/WikibaseLib.experimental.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -/** - * This file holds registration of experimental features part of the WikibaseLib extension. - * - * This file is NOT an entry point the WikibaseLib extension. Use WikibaseLib.php. - * It should furthermore not be included from outside the extension. - * - * @since 0.4 - * @licence GNU GPL v2+ - */ - -if ( !defined( 'WBL_VERSION' ) || !defined( 'WB_EXPERIMENTAL_FEATURES' ) ) { - die( 'Not an entry point.' ); -} - -//NOTE: any experimental default settings need to go into the -// appropriate section of WikibaseLib.defaults.php. diff --git a/lib/includes/LanguageFallbackChainFactory.php b/lib/includes/LanguageFallbackChainFactory.php index 6564961..8e63c48 100644 --- a/lib/includes/LanguageFallbackChainFactory.php +++ b/lib/includes/LanguageFallbackChainFactory.php @@ -52,23 +52,14 @@ /** * @var bool */ - private $isExperimentalMode; - - /** - * @var bool - */ public $anonymousPageViewCached; /** - * @param bool $isExperimentalMode * @param bool $anonymousPageViewCached Whether full page outputs are cached for anons, so some * fine-grained fallbacks shouldn't be used for them. */ - public function __construct( $isExperimentalMode = null, $anonymousPageViewCached = false ) { + public function __construct( $anonymousPageViewCached = false ) { // @fixme fix instantiation of factory in various lib classes - $this->isExperimentalMode = is_bool( $isExperimentalMode ) ? $isExperimentalMode - : defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES; - $this->anonymousPageViewCached = $anonymousPageViewCached; } @@ -344,6 +335,7 @@ * @return LanguageFallbackChain */ public function newFromContextForPageView( IContextSource $context ) { + // XXX: Unused? Remove? return $this->newFromUserAndLanguageCodeForPageView( $context->getUser(), $context->getLanguage()->getCode() @@ -357,19 +349,8 @@ * @return LanguageFallbackChain */ public function newFromUserAndLanguageCodeForPageView( User $user, $languageCode ) { - if ( $this->isExperimentalMode ) { - // The generated chain should yield a cacheable result - if ( $this->anonymousPageViewCached && $user->isAnon() ) { - // Anonymous users share the same Squid cache, which is splitted by URL. - // That means we can't do anything except for what completely depends - // by URL such as &uselang=. - return $this->newFromLanguageCode( $languageCode ); - } - - return $this->newFromUserAndLanguageCode( $user, $languageCode ); - } else { - return $this->newFromLanguageCode( $languageCode, self::FALLBACK_SELF ); - } + // XXX: Unused? Remove? + return $this->newFromLanguageCode( $languageCode, self::FALLBACK_SELF ); } } diff --git a/lib/tests/phpunit/LanguageFallbackChainFactoryTest.php b/lib/tests/phpunit/LanguageFallbackChainFactoryTest.php index 39346c3..86f7194 100644 --- a/lib/tests/phpunit/LanguageFallbackChainFactoryTest.php +++ b/lib/tests/phpunit/LanguageFallbackChainFactoryTest.php @@ -386,13 +386,13 @@ /** * @dataProvider newFromContextForPageViewProvider */ - public function testNewFromContextForPageView( $experimental, $anonymousPageViewCached, $msg ) { + public function testNewFromContextForPageView( $anonymousPageViewCached, $msg ) { $context = new RequestContext(); $context->setLanguage( Language::factory( 'es' ) ); $user = User::newFromId( 0 ); $context->setUser( $user ); - $factory = new LanguageFallbackChainFactory( $experimental, $anonymousPageViewCached ); + $factory = new LanguageFallbackChainFactory( $anonymousPageViewCached ); $fallbackChain = $factory->newFromContextForPageView( $context ); $this->assertInstanceOf( 'Wikibase\LanguageFallbackChain', $fallbackChain, $msg ); @@ -400,10 +400,8 @@ public function newFromContextForPageViewProvider() { return array( - array( false, true, 'non-experimental, anon cached page view' ), - array( false, false, 'non-experimental, not anon cached page view' ), - array( true, true, 'experimental, anon cached page view' ), - array( true, false, 'experimental, not anon cached page view' ) + array( true, 'anon cached page view' ), + array( false, 'not anon cached page view' ), ); } diff --git a/repo/Wikibase.php b/repo/Wikibase.php index 042d9e8..6e81826 100644 --- a/repo/Wikibase.php +++ b/repo/Wikibase.php @@ -39,8 +39,7 @@ return 1; } -define( 'WB_VERSION', '0.5 alpha' - . ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ? '/experimental' : '' ) ); +define( 'WB_VERSION', '0.5 alpha' ); if ( version_compare( $GLOBALS['wgVersion'], '1.26c', '<' ) ) { // Needs to be 1.26c because version_compare() works in confusing ways. die( "<b>Error:</b> Wikibase requires MediaWiki 1.26 or above.\n" ); @@ -255,9 +254,4 @@ require __DIR__ . '/../lib/config/WikibaseLib.default.php', require __DIR__ . '/config/Wikibase.default.php' ); - - if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES ) { - include_once __DIR__ . '/config/Wikibase.experimental.php'; - } - } ); diff --git a/repo/config/Wikibase.experimental.php b/repo/config/Wikibase.experimental.php deleted file mode 100644 index dc4634f..0000000 --- a/repo/config/Wikibase.experimental.php +++ /dev/null @@ -1,15 +0,0 @@ -<?php - -/** - * This file holds registration of experimental features part of the Wikibase Repo extension. - * - * This file is NOT an entry point the Wikibase extension. Use Wikibase.php. - * It should furthermore not be included from outside the extension. - * - * @since 0.4 - * @licence GNU GPL v2+ - */ - -if ( !defined( 'WB_VERSION' ) || !defined( 'WB_EXPERIMENTAL_FEATURES' ) ) { - die( 'Not an entry point.' ); -} diff --git a/repo/includes/Hooks/OutputPageJsConfigHookHandler.php b/repo/includes/Hooks/OutputPageJsConfigHookHandler.php index 60181e9..626fd78 100644 --- a/repo/includes/Hooks/OutputPageJsConfigHookHandler.php +++ b/repo/includes/Hooks/OutputPageJsConfigHookHandler.php @@ -81,7 +81,7 @@ */ public static function onOutputPageBeforeHtmlRegisterConfig( OutputPage $out, &$html ) { $instance = self::newFromGlobalState(); - return $instance->doOutputPageBeforeHtmlRegisterConfig( $out, $html ); + return $instance->doOutputPageBeforeHtmlRegisterConfig( $out ); } /** @@ -90,40 +90,36 @@ * * @return bool */ - public function doOutputPageBeforeHtmlRegisterConfig( OutputPage $out, &$html ) { + public function doOutputPageBeforeHtmlRegisterConfig( OutputPage $out ) { if ( !$this->entityNamespaceLookup->isEntityNamespace( $out->getTitle()->getNamespace() ) ) { return true; } - $isExperimental = defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES; - $this->handle( $out, $isExperimental ); + $this->handle( $out ); return true; } /** * @param OutputPage &$out - * @param boolean $isExperimental */ - private function handle( OutputPage $out, $isExperimental ) { - $outputConfigVars = $this->buildConfigVars( $out, $isExperimental ); + private function handle( OutputPage $out ) { + $outputConfigVars = $this->buildConfigVars( $out ); $out->addJsConfigVars( $outputConfigVars ); } /** * @param OutputPage $out - * @param boolean $isExperimental * * @return array */ - private function buildConfigVars( OutputPage $out, $isExperimental ) { + private function buildConfigVars( OutputPage $out ) { return $this->outputPageConfigBuilder->build( $out, $this->dataRightsUrl, $this->dataRightsText, - $this->badgeItems, - $isExperimental + $this->badgeItems ); } diff --git a/repo/includes/OutputPageJsConfigBuilder.php b/repo/includes/OutputPageJsConfigBuilder.php index 44999d8..37f9ac6 100644 --- a/repo/includes/OutputPageJsConfigBuilder.php +++ b/repo/includes/OutputPageJsConfigBuilder.php @@ -32,11 +32,10 @@ * @param string $rightsUrl * @param string $rightsText * @param string[] $badgeItems - * @param boolean $isExperimental * * @return array */ - public function build( OutputPage $out, $rightsUrl, $rightsText, array $badgeItems, $isExperimental ) { + public function build( OutputPage $out, $rightsUrl, $rightsText, array $badgeItems ) { $user = $out->getUser(); $lang = $out->getLanguage(); $title = $out->getTitle(); @@ -48,7 +47,8 @@ $configVars = array_merge( $userConfigVars, $copyrightConfig ); $configVars['wbBadgeItems'] = $badgeItems; - $configVars['wbExperimentalFeatures'] = $isExperimental; + // For b/c, remove after verifying that no one uses this anymore + $configVars['wbExperimentalFeatures'] = false; return $configVars; } diff --git a/repo/includes/WikibaseRepo.php b/repo/includes/WikibaseRepo.php index d0bcbb4..c2eebaf 100644 --- a/repo/includes/WikibaseRepo.php +++ b/repo/includes/WikibaseRepo.php @@ -637,10 +637,7 @@ // Squid. $anonymousPageViewCached = $wgUseSquid; - $this->languageFallbackChainFactory = new LanguageFallbackChainFactory( - defined( 'WB_EXPERIMENTAL_FEATURES' ) && WB_EXPERIMENTAL_FEATURES, - $anonymousPageViewCached - ); + $this->languageFallbackChainFactory = new LanguageFallbackChainFactory( $anonymousPageViewCached ); } return $this->languageFallbackChainFactory; diff --git a/repo/tests/phpunit/includes/Hooks/OutputPageJsConfigHookHandlerTest.php b/repo/tests/phpunit/includes/Hooks/OutputPageJsConfigHookHandlerTest.php index 119df01..fbd1bd3 100644 --- a/repo/tests/phpunit/includes/Hooks/OutputPageJsConfigHookHandlerTest.php +++ b/repo/tests/phpunit/includes/Hooks/OutputPageJsConfigHookHandlerTest.php @@ -28,7 +28,7 @@ /** * @dataProvider doOutputPageBeforeHtmlRegisterConfigProvider */ - public function testDoOutputPageBeforeHtmlRegisterConfig( array $expected, Title $title, $experimental, $message ) { + public function testDoOutputPageBeforeHtmlRegisterConfig( array $expected, Title $title, $message ) { $entityNamespaceLookup = new EntityNamespaceLookup( array( $title->getNamespace() ) ); $hookHandler = new OutputPageJsConfigHookHandler( $entityNamespaceLookup, 'https://creativecommons.org', 'CC-0', array() ); @@ -38,11 +38,11 @@ $output = $context->getOutput(); - $hookHandler->doOutputPageBeforeHtmlRegisterConfig( $output, $experimental ); + $hookHandler->doOutputPageBeforeHtmlRegisterConfig( $output ); $configVars = $output->getJsConfigVars(); - $this->assertEquals( $experimental, $configVars['wbExperimentalFeatures'], 'experimental' ); + $this->assertEquals( false, $configVars['wbExperimentalFeatures'], 'experimental (b/c, always false)' ); $this->assertEquals( $expected, array_keys( $configVars ), $message ); } diff --git a/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php b/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php index f683c6a..965acd5 100644 --- a/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php +++ b/repo/tests/phpunit/includes/Notifications/ChangeNotifierTest.php @@ -55,11 +55,6 @@ return $content; } - private function itemSupportsRedirects() { - $handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKIBASE_ITEM ); - return $handler->supportsRedirects(); - } - /** * @param ItemId $id * @param ItemId $target @@ -68,10 +63,6 @@ * @return EntityContent */ protected function makeItemRedirectContent( ItemId $id, ItemId $target ) { - if ( !$this->itemSupportsRedirects() ) { - throw new RuntimeException( 'Redirects are not yet supported.' ); - } - $title = Title::newFromText( $target->getSerialization() ); $redirect = new EntityRedirect( $id, $target ); $content = ItemContent::newFromRedirect( $redirect, $title ); @@ -137,12 +128,6 @@ } public function testNotifyOnPageDeleted_redirect() { - if ( !$this->itemSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $user = $this->makeUser( 'ChangeNotifierTestUser' ); $timestamp = '20140523' . '174822'; $content = $this->makeItemRedirectContent( new ItemId( 'Q12' ), new ItemId( 'Q17' ) ); @@ -190,12 +175,6 @@ } public function testNotifyOnPageUndeleted_redirect() { - if ( !$this->itemSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $user = $this->makeUser( 'ChangeNotifierTestUser' ); $user->setId( 17 ); @@ -235,12 +214,6 @@ } public function testNotifyOnPageCreated_redirect() { - if ( !$this->itemSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $user = $this->makeUser( 'ChangeNotifierTestUser' ); $timestamp = '20140523' . '174822'; $revisionId = 12345; @@ -282,12 +255,6 @@ } public function testNotifyOnPageModified_redirect() { - if ( !$this->itemSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $user = $this->makeUser( 'ChangeNotifierTestUser' ); $timestamp = '20140523' . '174822'; $revisionId = 12345; @@ -305,12 +272,6 @@ } public function testNotifyOnPageModified_from_redirect() { - if ( !$this->itemSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $user = $this->makeUser( 'ChangeNotifierTestUser' ); $timestamp = '20140523' . '174822'; $revisionId = 12345; @@ -337,12 +298,6 @@ } public function testNotifyOnPageModified_to_redirect() { - if ( !$this->itemSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $user = $this->makeUser( 'ChangeNotifierTestUser' ); $timestamp = '20140523' . '174822'; $revisionId = 12345; diff --git a/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php b/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php index 4298d0c..ecdb3e8 100644 --- a/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php +++ b/repo/tests/phpunit/includes/OutputPageJsConfigBuilderTest.php @@ -50,7 +50,7 @@ 'Q12' => 'wb-badge-goodarticle', 'Q42' => 'wb-badge-featuredarticle' ), - 'wbExperimentalFeatures' => true + 'wbExperimentalFeatures' => false ); $this->assertEquals( $expected, $configVars ); diff --git a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php index 04361bf..c48c262 100644 --- a/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php +++ b/repo/tests/phpunit/includes/content/EntityContentFactoryTest.php @@ -293,12 +293,6 @@ * @param EntityRedirect $redirect */ public function testNewFromRedirect( EntityRedirect $redirect ) { - if ( !$this->supportsRedirects() ) { - // As of 2014-07-03, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $factory = $this->newFactory(); $content = $factory->newFromRedirect( $redirect ); diff --git a/repo/tests/phpunit/includes/content/ItemContentTest.php b/repo/tests/phpunit/includes/content/ItemContentTest.php index ae9a9e8..2570e2b 100644 --- a/repo/tests/phpunit/includes/content/ItemContentTest.php +++ b/repo/tests/phpunit/includes/content/ItemContentTest.php @@ -232,19 +232,8 @@ return $cases; } - private function handlerSupportsRedirects() { - $handler = ContentHandler::getForModelID( CONTENT_MODEL_WIKIBASE_ITEM ); - return $handler->supportsRedirects(); - } - public function diffProvider() { $cases = parent::diffProvider(); - - if ( !$this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - return $cases; - } $q10 = new ItemId( 'Q10' ); $empty = $this->newEmpty( $q10 ); @@ -298,12 +287,6 @@ public function patchedCopyProvider() { $cases = parent::patchedCopyProvider(); - if ( !$this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - return $cases; - } - $q10 = new ItemId( 'Q10' ); $empty = $this->newEmpty( $q10 ); @@ -353,12 +336,6 @@ public function copyProvider() { $cases = parent::copyProvider(); - if ( !$this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - return $cases; - } - $redir = $this->newRedirect( new ItemId( 'Q5' ), new ItemId( 'Q7' ) ); $cases['redirect'] = array( $redir ); @@ -368,12 +345,6 @@ public function equalsProvider() { $cases = parent::equalsProvider(); - - if ( !$this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - return $cases; - } $redir = $this->newRedirect( new ItemId( 'Q5' ), new ItemId( 'Q7' ) ); @@ -388,12 +359,6 @@ } public function testGetParserOutput_redirect() { - if ( !$this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $content = $this->newRedirect( new ItemId( 'Q5' ), new ItemId( 'Q123' ) ); $title = Title::newFromText( 'Foo' ); @@ -412,24 +377,13 @@ $cases = array(); $cases['entity id'] = array( $this->newEmpty( $q11 ), $q11 ); - - if ( $this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $cases['redirect id'] = array( $this->newRedirect( $q11, $q12 ), $q11 ); - } + $cases['redirect id'] = array( $this->newRedirect( $q11, $q12 ), $q11 ); return $cases; } public function entityRedirectProvider() { $cases = parent::entityRedirectProvider(); - - if ( !$this->handlerSupportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - return $cases; - } $cases['redirect'] = array( $this->newRedirect( new ItemId( 'Q11' ), new ItemId( 'Q12' ) ), diff --git a/repo/tests/phpunit/includes/content/ItemHandlerTest.php b/repo/tests/phpunit/includes/content/ItemHandlerTest.php index beae8aa..f8b85b0 100644 --- a/repo/tests/phpunit/includes/content/ItemHandlerTest.php +++ b/repo/tests/phpunit/includes/content/ItemHandlerTest.php @@ -64,12 +64,6 @@ public function provideGetUndoContent() { $cases = parent::provideGetUndoContent(); - if ( !$this->getHandler()->supportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - return $cases; - } - $e1 = $this->newEntity(); $e1->setLabel( 'en', 'Foo' ); $r1 = $this->fakeRevision( $this->newEntityContent( $e1 ), 11 ); @@ -106,12 +100,6 @@ } public function testMakeEntityRedirectContent() { - if ( !$this->getHandler()->supportsRedirects() ) { - // As of 2014-06-30, redirects are still experimental. - // So do a feature check before trying to test redirects. - $this->markTestSkipped( 'Redirects not yet supported.' ); - } - $q2 = new ItemId( 'Q2' ); $q3 = new ItemId( 'Q3' ); $redirect = new EntityRedirect( $q2, $q3 ); -- To view, visit https://gerrit.wikimedia.org/r/250035 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fd3c44cc4594f4ec2e50850803aae871d399181 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Wikibase Gerrit-Branch: master Gerrit-Owner: Hoo man <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
