Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/224643
Change subject: Convert spaces to tabs in SpecialExternalDbsTest.php
......................................................................
Convert spaces to tabs in SpecialExternalDbsTest.php
Change-Id: I9a319107914a1cd56798ada6760bd8c1b3388cf0
---
M tests/phpunit/Specials/SpecialExternalDbsTest.php
1 file changed, 165 insertions(+), 169 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityExternalValidation
refs/changes/43/224643/1
diff --git a/tests/phpunit/Specials/SpecialExternalDbsTest.php
b/tests/phpunit/Specials/SpecialExternalDbsTest.php
index b72031e..22a8e25 100755
--- a/tests/phpunit/Specials/SpecialExternalDbsTest.php
+++ b/tests/phpunit/Specials/SpecialExternalDbsTest.php
@@ -8,7 +8,6 @@
use WikibaseQuality\ExternalValidation\ExternalValidationServices;
use WikibaseQuality\ExternalValidation\Specials\SpecialExternalDbs;
-
/**
* @covers WikibaseQuality\ExternalValidation\Specials\SpecialExternalDbs
*
@@ -25,17 +24,16 @@
* @author BP2014N1
* @license GNU GPL v2+
*/
-class SpecialExternalDbsTest extends SpecialPageTestBase
-{
+class SpecialExternalDbsTest extends SpecialPageTestBase {
- protected function setUp() {
- parent::setUp();
+ protected function setUp() {
+ parent::setUp();
- $this->tablesUsed[ ] = SqlDumpMetaInformationRepo::META_TABLE_NAME;
- $this->tablesUsed[ ] =
SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME;
- }
+ $this->tablesUsed[] =
SqlDumpMetaInformationRepo::META_TABLE_NAME;
+ $this->tablesUsed[] =
SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME;
+ }
- protected function newSpecialPage() {
+ protected function newSpecialPage() {
$externalValidationFactory =
ExternalValidationServices::getDefaultInstance();
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
@@ -44,191 +42,189 @@
$wikibaseRepo->getEntityIdHtmlLinkFormatterFactory(),
$externalValidationFactory->getDumpMetaInformationLookup()
);
- }
+ }
- /**
- * Adds temporary test data to database
- * @throws \DBUnexpectedError
- */
- public function addDBData()
- {
- // Truncate table
- $this->db->delete(
- SqlDumpMetaInformationRepo::META_TABLE_NAME,
- '*'
- );
- $this->db->delete(
- SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME,
- '*'
- );
+ /**
+ * Adds temporary test data to database
+ * @throws \DBUnexpectedError
+ */
+ public function addDBData() {
+ // Truncate table
+ $this->db->delete(
+ SqlDumpMetaInformationRepo::META_TABLE_NAME,
+ '*'
+ );
+ $this->db->delete(
+
SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME,
+ '*'
+ );
- $this->db->insert(
- SqlDumpMetaInformationRepo::META_TABLE_NAME,
- array(
- 'id' => 'foobar',
- 'source_qid' => 'Q36578',
- 'import_date' => '20150101000000',
- 'language' => 'en',
- 'source_url' => 'http://www.foo.bar',
- 'size' => 42,
- 'license_qid' => 'Q6938433'
- )
- );
- $this->db->insert(
- SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME,
- array(
- 'dump_id' => 'foobar',
- 'identifier_pid' => 'P227'
- )
- );
- }
+ $this->db->insert(
+ SqlDumpMetaInformationRepo::META_TABLE_NAME,
+ array(
+ 'id' => 'foobar',
+ 'source_qid' => 'Q36578',
+ 'import_date' => '20150101000000',
+ 'language' => 'en',
+ 'source_url' => 'http://www.foo.bar',
+ 'size' => 42,
+ 'license_qid' => 'Q6938433'
+ )
+ );
+ $this->db->insert(
+
SqlDumpMetaInformationRepo::IDENTIFIER_PROPERTIES_TABLE_NAME,
+ array(
+ 'dump_id' => 'foobar',
+ 'identifier_pid' => 'P227'
+ )
+ );
+ }
- /**
- * @dataProvider executeProvider
- */
- public function testExecute( $subPage, $request, $userLanguage, $matchers
) {
- $request = new \FauxRequest( $request );
+ /**
+ * @dataProvider executeProvider
+ */
+ public function testExecute( $subPage, $request, $userLanguage,
$matchers ) {
+ $request = new \FauxRequest( $request );
- // Truncate table if checking for no database available
- if ( isset( $matchers['no databases'] ) ) {
- $this->db->delete(
- SqlDumpMetaInformationRepo::META_TABLE_NAME,
- '*'
- );
- }
+ // Truncate table if checking for no database available
+ if ( isset( $matchers['no databases'] ) ) {
+ $this->db->delete(
+ SqlDumpMetaInformationRepo::META_TABLE_NAME,
+ '*'
+ );
+ }
- // assert matchers
- list( $output, ) = $this->executeSpecialPage( $subPage, $request,
$userLanguage );
- foreach( $matchers as $key => $matcher ) {
- $this->assertTag( $matcher, $output, "Failed to assert output:
$key" );
- }
- }
+ // assert matchers
+ list( $output, ) = $this->executeSpecialPage( $subPage,
$request, $userLanguage );
+ foreach ( $matchers as $key => $matcher ) {
+ $this->assertTag( $matcher, $output, "Failed to assert
output: $key" );
+ }
+ }
- public function executeProvider()
- {
- $userLanguage = 'qqx';
- $cases = array();
- $matchers = array();
+ public function executeProvider() {
+ $userLanguage = 'qqx';
+ $cases = array();
+ $matchers = array();
- // Empty input with database
- $matchers['instructions'] = array(
- 'tag' => 'p',
- 'content' => '(wbqev-externaldbs-instructions)'
- );
+ // Empty input with database
+ $matchers['instructions'] = array(
+ 'tag' => 'p',
+ 'content' => '(wbqev-externaldbs-instructions)'
+ );
- $matchers['headline'] = array(
- 'tag' => 'h3',
- 'content' => '(wbqev-externaldbs-overview-headline)'
- );
+ $matchers['headline'] = array(
+ 'tag' => 'h3',
+ 'content' => '(wbqev-externaldbs-overview-headline)'
+ );
- $matchers['database table'] = array(
- 'tag' => 'table',
- 'attributes' => array(
- 'class' => 'wikitable'
- )
- );
+ $matchers['database table'] = array(
+ 'tag' => 'table',
+ 'attributes' => array(
+ 'class' => 'wikitable'
+ )
+ );
- $matchers['column name'] = array(
- 'tag' => 'th',
- 'attributes' => array(
- 'role' => 'columnheader button'
- ),
- 'content' => '(wbqev-externaldbs-name)'
- );
+ $matchers['column name'] = array(
+ 'tag' => 'th',
+ 'attributes' => array(
+ 'role' => 'columnheader button'
+ ),
+ 'content' => '(wbqev-externaldbs-name)'
+ );
- $matchers['column import date'] = array(
- 'tag' => 'th',
- 'attributes' => array(
- 'role' => 'columnheader button'
- ),
- 'content' => '(wbqev-externaldbs-import-date)'
- );
+ $matchers['column import date'] = array(
+ 'tag' => 'th',
+ 'attributes' => array(
+ 'role' => 'columnheader button'
+ ),
+ 'content' => '(wbqev-externaldbs-import-date)'
+ );
- $matchers['column data language'] = array(
- 'tag' => 'th',
- 'attributes' => array(
- 'role' => 'columnheader button'
- ),
- 'content' => '(wbqev-externaldbs-language)'
- );
+ $matchers['column data language'] = array(
+ 'tag' => 'th',
+ 'attributes' => array(
+ 'role' => 'columnheader button'
+ ),
+ 'content' => '(wbqev-externaldbs-language)'
+ );
- $matchers['column source urls'] = array(
- 'tag' => 'th',
- 'attributes' => array(
- 'role' => 'columnheader button'
- ),
- 'content' => '(wbqev-externaldbs-source-urls)'
- );
+ $matchers['column source urls'] = array(
+ 'tag' => 'th',
+ 'attributes' => array(
+ 'role' => 'columnheader button'
+ ),
+ 'content' => '(wbqev-externaldbs-source-urls)'
+ );
- $matchers['column size'] = array(
- 'tag' => 'th',
- 'attributes' => array(
- 'role' => 'columnheader button'
- ),
- 'content' => '(wbqev-externaldbs-size)'
- );
+ $matchers['column size'] = array(
+ 'tag' => 'th',
+ 'attributes' => array(
+ 'role' => 'columnheader button'
+ ),
+ 'content' => '(wbqev-externaldbs-size)'
+ );
- $matchers['column license'] = array(
- 'tag' => 'th',
- 'attributes' => array(
- 'role' => 'columnheader button'
- ),
- 'content' => '(wbqev-externaldbs-license)'
- );
+ $matchers['column license'] = array(
+ 'tag' => 'th',
+ 'attributes' => array(
+ 'role' => 'columnheader button'
+ ),
+ 'content' => '(wbqev-externaldbs-license)'
+ );
- $matchers['value name'] = array(
- 'tag' => 'td',
- 'attributes' => array(
- 'rowspan' => '1'
- ),
- 'content' => 'Q36578'
- );
+ $matchers['value name'] = array(
+ 'tag' => 'td',
+ 'attributes' => array(
+ 'rowspan' => '1'
+ ),
+ 'content' => 'Q36578'
+ );
- $matchers['value import date'] = array(
- 'tag' => 'td'
- );
+ $matchers['value import date'] = array(
+ 'tag' => 'td'
+ );
- $matchers['value data language'] = array(
- 'tag' => 'td',
- 'content' => 'English'
- );
+ $matchers['value data language'] = array(
+ 'tag' => 'td',
+ 'content' => 'English'
+ );
- $matchers['value source urls'] = array(
- 'tag' => 'td',
- 'content' => 'http://www.foo.bar'
- );
+ $matchers['value source urls'] = array(
+ 'tag' => 'td',
+ 'content' => 'http://www.foo.bar'
+ );
- $matchers['value size'] = array(
- 'tag' => 'td',
- 'content' => '(size-bytes)'
- );
+ $matchers['value size'] = array(
+ 'tag' => 'td',
+ 'content' => '(size-bytes)'
+ );
- $matchers['value license'] = array(
- 'tag' => 'td',
- 'content' => 'Q6938433'
- );
+ $matchers['value license'] = array(
+ 'tag' => 'td',
+ 'content' => 'Q6938433'
+ );
- $cases['empty with database'] = array('', array(), $userLanguage,
$matchers);
+ $cases['empty with database'] = array( '', array(),
$userLanguage, $matchers );
- // Empty input without databases
- unset( $matchers );
- $matchers['instructions'] = array(
- 'tag' => 'p',
- 'content' => '(wbqev-externaldbs-instructions)'
- );
+ // Empty input without databases
+ unset( $matchers );
+ $matchers['instructions'] = array(
+ 'tag' => 'p',
+ 'content' => '(wbqev-externaldbs-instructions)'
+ );
- $matchers['headline'] = array(
- 'tag' => 'h3',
- 'content' => '(wbqev-externaldbs-overview-headline)'
- );
+ $matchers['headline'] = array(
+ 'tag' => 'h3',
+ 'content' => '(wbqev-externaldbs-overview-headline)'
+ );
- $matchers['no databases'] = array(
- 'tag' => 'p',
- 'content' => '(wbqev-externaldbs-no-databases)'
- );
+ $matchers['no databases'] = array(
+ 'tag' => 'p',
+ 'content' => '(wbqev-externaldbs-no-databases)'
+ );
- $cases['empty without databases'] = array('', array(), $userLanguage,
$matchers);
+ $cases['empty without databases'] = array( '', array(),
$userLanguage, $matchers );
- return $cases;
- }
+ return $cases;
+ }
}
\ No newline at end of file
--
To view, visit https://gerrit.wikimedia.org/r/224643
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9a319107914a1cd56798ada6760bd8c1b3388cf0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQualityExternalValidation
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits