diff options
Diffstat (limited to 'www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Import/Maintenance/UpdateEntityCollationTest.php')
-rw-r--r-- | www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Import/Maintenance/UpdateEntityCollationTest.php | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Import/Maintenance/UpdateEntityCollationTest.php b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Import/Maintenance/UpdateEntityCollationTest.php new file mode 100644 index 00000000..b6cb2285 --- /dev/null +++ b/www/wiki/extensions/SemanticMediaWiki/tests/phpunit/Integration/MediaWiki/Import/Maintenance/UpdateEntityCollationTest.php @@ -0,0 +1,74 @@ +<?php + +namespace SMW\Tests\Integration\MediaWiki\Import\Maintenance; + +use SMW\Tests\MwDBaseUnitTestCase; +use SMW\Tests\Utils\UtilityFactory; + +/** + * @group semantic-mediawiki + * @group medium + * + * @license GNU GPL v2+ + * @since 3.0 + * + * @author mwjames + */ +class UpdateEntityCollationTest extends MwDBaseUnitTestCase { + + protected $destroyDatabaseTablesAfterRun = true; + + private $importedTitles = []; + private $runnerFactory; + private $titleValidator; + + protected function setUp() { + parent::setUp(); + + $this->runnerFactory = UtilityFactory::getInstance()->newRunnerFactory(); + $this->titleValidator = UtilityFactory::getInstance()->newValidatorFactory()->newTitleValidator(); + + $importRunner = $this->runnerFactory->newXmlImportRunner( + __DIR__ . '/../Fixtures/' . 'GenericLoremIpsumTest-Mw-1-19-7.xml' + ); + + if ( !$importRunner->setVerbose( true )->run() ) { + $importRunner->reportFailedImport(); + $this->markTestIncomplete( 'Test was marked as incomplete because the data import failed' ); + } + } + + protected function tearDown() { + + $pageDeleter = UtilityFactory::getInstance()->newPageDeleter(); + $pageDeleter->doDeletePoolOfPages( $this->importedTitles ); + + parent::tearDown(); + } + + public function testSortFieldUpdate() { + + $this->importedTitles = [ + 'Category:Lorem ipsum', + 'Lorem ipsum', + 'Elit Aliquam urna interdum', + 'Platea enim hendrerit', + 'Property:Has Url', + 'Property:Has annotation uri', + 'Property:Has boolean', + 'Property:Has date', + 'Property:Has email', + 'Property:Has number', + 'Property:Has page', + 'Property:Has quantity', + 'Property:Has temperature', + 'Property:Has text' + ]; + + $this->titleValidator->assertThatTitleIsKnown( $this->importedTitles ); + + $maintenanceRunner = $this->runnerFactory->newMaintenanceRunner( 'SMW\Maintenance\UpdateEntityCollation' ); + $maintenanceRunner->setQuiet()->run(); + } + +} |