Addshore has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231525
Change subject: Fix phpcs issues in /tests
......................................................................
Fix phpcs issues in /tests
Change-Id: I1bbaa5444cef21d2be5e5a3b218038090b2fae15
---
M tests/phpunit/Api/ModifyViolationTest.php
M tests/phpunit/Helper/JsonFileEntityLookup.php
M tests/phpunit/Html/HtmlTableBuilderTest.php
M tests/phpunit/Html/HtmlTableCellBuilderTest.php
M tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
M tests/phpunit/Serializer/ViolationSerializerTest.php
M tests/phpunit/Specials/SpecialViolationsPageTest.php
M tests/phpunit/Violations/DispatchingViolationFormatterTest.php
M tests/phpunit/Violations/SqlViolationRepoTest.php
M tests/phpunit/Violations/ViolationQueryTest.php
M tests/phpunit/Violations/ViolationTest.php
M tests/phpunit/WikibaseQualityServicesTest.php
12 files changed, 238 insertions(+), 106 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQuality
refs/changes/25/231525/1
diff --git a/tests/phpunit/Api/ModifyViolationTest.php
b/tests/phpunit/Api/ModifyViolationTest.php
index 8ffb546..c566445 100644
--- a/tests/phpunit/Api/ModifyViolationTest.php
+++ b/tests/phpunit/Api/ModifyViolationTest.php
@@ -116,7 +116,10 @@
'constraintid' =>
'P667$aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee',
'status' => 'exception'
);
- $this->setExpectedException( 'UsageException', 'Violations with
given identifiers does not exist!' );
+ $this->setExpectedException(
+ 'UsageException',
+ 'Violations with given identifiers does not exist!'
+ );
$this->doApiRequestWithToken( $params );
}
@@ -128,7 +131,10 @@
'status' => 'exception'
);
$this->setUpPermissions( false );
- $this->setExpectedException( 'UsageException', 'You do not have
the permission to change this violation!' );
+ $this->setExpectedException(
+ 'UsageException',
+ 'You do not have the permission to change this
violation!'
+ );
$this->doApiRequestWithToken( $params, null, $this->testUser );
}
@@ -163,7 +169,7 @@
$groupPermissions = $GLOBALS['wgGroupPermissions'];
$groupPermissions['*']['edit'] = $isPermitted;
$groupPermissions['*']['wikibase-violation-exception'] =
$isPermitted;
- $this->setMwGlobals( 'wgGroupPermissions', $groupPermissions);
+ $this->setMwGlobals( 'wgGroupPermissions', $groupPermissions );
$this->testUser->clearInstanceCache();
}
diff --git a/tests/phpunit/Helper/JsonFileEntityLookup.php
b/tests/phpunit/Helper/JsonFileEntityLookup.php
index 238ca1c..34f7e33 100644
--- a/tests/phpunit/Helper/JsonFileEntityLookup.php
+++ b/tests/phpunit/Helper/JsonFileEntityLookup.php
@@ -10,7 +10,6 @@
use Wikibase\DataModel\Services\Lookup\EntityLookup;
use Wikibase\Repo\WikibaseRepo;
-
class JsonFileEntityLookup implements EntityLookup {
/**
diff --git a/tests/phpunit/Html/HtmlTableBuilderTest.php
b/tests/phpunit/Html/HtmlTableBuilderTest.php
index b6c6ee4..de7d7c5 100644
--- a/tests/phpunit/Html/HtmlTableBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableBuilderTest.php
@@ -6,7 +6,6 @@
use WikibaseQuality\Html\HtmlTableCellBuilder;
use WikibaseQuality\Html\HtmlTableHeaderBuilder;
-
/**
* @covers WikibaseQuality\Html\HtmlTableBuilder
*
@@ -25,7 +24,12 @@
/**
* @dataProvider constructDataProvider
*/
- public function testConstruct( $headers, $expectedHeaders,
$expectedIsSortable, $expectedException ) {
+ public function testConstruct(
+ $headers,
+ $expectedHeaders,
+ $expectedIsSortable,
+ $expectedException
+ ) {
$this->setExpectedException( $expectedException );
$htmlTable = new HtmlTableBuilder( $headers );
@@ -41,74 +45,74 @@
array(
array(
'foo',
- 'bar'
+ 'bar',
),
- array (
+ array(
new HtmlTableHeaderBuilder( 'foo' ),
- new HtmlTableHeaderBuilder( 'bar' )
+ new HtmlTableHeaderBuilder( 'bar' ),
),
false,
- null
+ null,
),
- array (
- array (
+ array(
+ array(
new HtmlTableHeaderBuilder( 'foo', true
),
- 'bar'
+ 'bar',
),
- array (
+ array(
new HtmlTableHeaderBuilder( 'foo', true
),
- new HtmlTableHeaderBuilder( 'bar' )
+ new HtmlTableHeaderBuilder( 'bar' ),
),
true,
- null
+ null,
),
- array (
- array (
+ array(
+ array(
new HtmlTableHeaderBuilder( 'foo', true
),
- new HtmlTableHeaderBuilder( 'bar' )
+ new HtmlTableHeaderBuilder( 'bar' ),
),
- array (
+ array(
new HtmlTableHeaderBuilder( 'foo', true
),
- new HtmlTableHeaderBuilder( 'bar' )
+ new HtmlTableHeaderBuilder( 'bar' ),
),
true,
- null
+ null,
),
array(
array( 42 ),
null,
false,
- 'InvalidArgumentException'
+ 'InvalidArgumentException',
),
array(
'foobar',
null,
false,
- 'InvalidArgumentException'
- )
+ 'InvalidArgumentException',
+ ),
);
}
public function testAppendRow() {
$htmlTable = new HtmlTableBuilder(
- array (
+ array(
'fu',
- 'bar'
+ 'bar',
)
);
$htmlTable->appendRow(
array(
'foo',
- 'bar'
+ 'bar',
)
);
$this->assertArrayEquals(
- array (
- array (
+ array(
+ array(
new HtmlTableCellBuilder( 'foo' ),
- new HtmlTableCellBuilder( 'bar' )
- )
+ new HtmlTableCellBuilder( 'bar' ),
+ ),
),
$htmlTable->getRows()
);
@@ -123,9 +127,9 @@
}
$htmlTable = new HtmlTableBuilder(
- array (
+ array(
'fu',
- 'bar'
+ 'bar',
)
);
$htmlTable->appendRows( $rows );
@@ -144,47 +148,47 @@
array(
array(
'foo',
- 'bar'
- )
+ 'bar',
+ ),
),
- array (
- array (
+ array(
+ array(
new HtmlTableCellBuilder( 'foo'
),
- new HtmlTableCellBuilder( 'bar'
)
- )
- )
+ new HtmlTableCellBuilder( 'bar'
),
+ ),
+ ),
),
- array (
- array (
- array (
+ array(
+ array(
+ array(
new HtmlTableCellBuilder( 'foo'
),
- 'bar'
- )
+ 'bar',
+ ),
),
- array (
- array (
+ array(
+ array(
new HtmlTableCellBuilder( 'foo'
),
- new HtmlTableCellBuilder( 'bar'
)
- )
- )
+ new HtmlTableCellBuilder( 'bar'
),
+ ),
+ ),
),
array(
array(
array(
'foo',
- 42
- )
+ 42,
+ ),
),
null,
- 'InvalidArgumentException'
+ 'InvalidArgumentException',
),
array(
array(
- 42
+ 42,
),
null,
- 'InvalidArgumentException'
- )
+ 'InvalidArgumentException',
+ ),
);
}
@@ -209,34 +213,35 @@
array(
array(
$this->getHtmlTableHeaderMock( 'fu' ),
- $this->getHtmlTableHeaderMock( 'bar' )
+ $this->getHtmlTableHeaderMock( 'bar' ),
),
array(
array(
$this->getHtmlTableCellMock(
'fucked up' ),
- $this->getHtmlTableCellMock(
'beyond all recognition' )
- )
+ $this->getHtmlTableCellMock(
'beyond all recognition' ),
+ ),
),
- '<table
class="wikitable"><tr><th>fu</th><th>bar</th></tr><tr><td>fucked
up</td><td>beyond all recognition</td></tr></table>'
+ '<table
class="wikitable"><tr><th>fu</th><th>bar</th></tr><tr><td>fucked
up</td><td>beyond all recognition</td></tr></table>',
),
array(
array(
$this->getHtmlTableHeaderMock( 'fu' ),
- $this->getHtmlTableHeaderMock( 'bar',
true )
+ $this->getHtmlTableHeaderMock( 'bar',
true ),
),
array(
array(
$this->getHtmlTableCellMock(
'fucked up' ),
- $this->getHtmlTableCellMock(
'beyond all recognition' )
- )
+ $this->getHtmlTableCellMock(
'beyond all recognition' ),
+ ),
),
- '<table class="wikitable sortable
jquery-tablesort"><tr><th>fu</th><th>bar</th></tr><tr><td>fucked
up</td><td>beyond all recognition</td></tr></table>'
- )
+ '<table class="wikitable sortable
jquery-tablesort"><tr><th>fu</th><th>bar</th></tr><tr><td>fucked
up</td><td>beyond all recognition</td></tr></table>',
+ ),
);
}
/**
- * Creates HtmlHeaderCell mock, which returns only the content when
calling HtmlHeaderCell::toHtml()
+ * Creates HtmlHeaderCell mock, which returns only the content when
calling
+ * HtmlHeaderCell::toHtml()
*
* @param string $content
*
@@ -257,7 +262,8 @@
}
/**
- * Creates HtmlTableCell mock, which returns only the content when
calling HtmlTableCell::toHtml()
+ * Creates HtmlTableCell mock, which returns only the content when
calling
+ * HtmlTableCell::toHtml()
*
* @param string $content
*
diff --git a/tests/phpunit/Html/HtmlTableCellBuilderTest.php
b/tests/phpunit/Html/HtmlTableCellBuilderTest.php
index f6ea156..2762165 100644
--- a/tests/phpunit/Html/HtmlTableCellBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableCellBuilderTest.php
@@ -1,10 +1,8 @@
<?php
-
namespace WikibaseQuality\ExternalValidation\Tests\Html;
use WikibaseQuality\Html\HtmlTableCellBuilder;
-
/**
* @covers WikibaseQuality\Html\HtmlTableCellBuilder
diff --git a/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
b/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
index ccb99d2..1b33057 100644
--- a/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
+++ b/tests/phpunit/Html/HtmlTableHeaderBuilderTest.php
@@ -1,10 +1,8 @@
<?php
-
namespace WikibaseQuality\ExternalValidation\Tests\Html;
use WikibaseQuality\Html\HtmlTableHeaderBuilder;
-
/**
* @covers WikibaseQuality\Html\HtmlTableHeaderBuilder
diff --git a/tests/phpunit/Serializer/ViolationSerializerTest.php
b/tests/phpunit/Serializer/ViolationSerializerTest.php
index 086e9ba..4fcbf76 100644
--- a/tests/phpunit/Serializer/ViolationSerializerTest.php
+++ b/tests/phpunit/Serializer/ViolationSerializerTest.php
@@ -49,14 +49,26 @@
$serializedViolation = $this->violationSerializer->serialize(
$violation );
- $this->assertEquals(
$violation->getEntityId()->getSerialization(), $serializedViolation['entityId']
);
- $this->assertEquals(
$violation->getPropertyId()->getSerialization(),
$serializedViolation['propertyId'] );
+ $this->assertEquals(
+ $violation->getEntityId()->getSerialization(),
+ $serializedViolation['entityId']
+ );
+ $this->assertEquals(
+ $violation->getPropertyId()->getSerialization(),
+ $serializedViolation['propertyId']
+ );
$this->assertEquals( $violation->getClaimGuid(),
$serializedViolation['claimGuid'] );
$this->assertEquals( $violation->getConstraintId(),
$serializedViolation['constraintId'] );
- $this->assertEquals( $violation->getConstraintTypeEntityId(),
$serializedViolation['constraintTypeEntityId'] );
+ $this->assertEquals(
+ $violation->getConstraintTypeEntityId(),
+ $serializedViolation['constraintTypeEntityId']
+ );
$this->assertEquals( $violation->getRevisionId(),
$serializedViolation['revisionId'] );
$this->assertEquals( $violation->getStatus(),
$serializedViolation['status'] );
- $this->assertEquals( $violation->getAdditionalInfo(),
$serializedViolation['additionalInfo'] );
+ $this->assertEquals(
+ $violation->getAdditionalInfo(),
+ $serializedViolation['additionalInfo']
+ );
$this->assertEquals( $violation->getUpdatedAt(),
$serializedViolation['updatedAt'] );
}
diff --git a/tests/phpunit/Specials/SpecialViolationsPageTest.php
b/tests/phpunit/Specials/SpecialViolationsPageTest.php
index 8225f01..a2fe789 100644
--- a/tests/phpunit/Specials/SpecialViolationsPageTest.php
+++ b/tests/phpunit/Specials/SpecialViolationsPageTest.php
@@ -78,7 +78,12 @@
$dataValue = new StringValue( 'foo' );
$snak = new PropertyValueSnak( self::$idMap['P1'],
$dataValue );
- $claimGuid = sprintf(
'%s%scc9cf0b2-ff64-451c-8e4a-2f0b38f6e7ce', self::$idMap['Q1'],
ClaimGuid::SEPARATOR );
+ $claimGuid =
+ sprintf(
+
'%s%scc9cf0b2-ff64-451c-8e4a-2f0b38f6e7ce',
+ self::$idMap['Q1'],
+ ClaimGuid::SEPARATOR
+ );
self::$claimGuids['P1'] = $claimGuid;
$statement = new Statement( $snak );
$statement->setGuid( $claimGuid );
@@ -88,7 +93,12 @@
$dataValue = new StringValue( 'foo' );
$snak = new PropertyValueSnak( self::$idMap['P2'],
$dataValue );
- $claimGuid = sprintf(
'%s%sbe55b140-7fb5-40e0-87ee-826fd452687d', self::$idMap['Q2'],
ClaimGuid::SEPARATOR );
+ $claimGuid =
+ sprintf(
+
'%s%sbe55b140-7fb5-40e0-87ee-826fd452687d',
+ self::$idMap['Q2'],
+ ClaimGuid::SEPARATOR
+ );
self::$claimGuids['P2'] = $claimGuid;
$statement = new Statement( $snak );
$statement->setGuid( $claimGuid );
@@ -194,14 +204,21 @@
* @dataProvider executeProvider
*/
public function testExecute( $requestData, $matchers ) {
- // Replace dummy entity ids and claim guids with real ones.
This solves the problem that the provider is executed before the test
- if ( array_key_exists( 'entityid', $requestData ) &&
array_key_exists( $requestData['entityid'], self::$idMap ) ) {
+ // Replace dummy entity ids and claim guids with real ones.
+ // This solves the problem that the provider is executed before
the test.
+ if ( array_key_exists( 'entityid', $requestData ) &&
+ array_key_exists( $requestData['entityid'],
self::$idMap )
+ ) {
$requestData['entityid'] =
self::$idMap[$requestData['entityid']];
}
- if ( array_key_exists( 'pid', $requestData ) &&
array_key_exists( $requestData['pid'], self::$idMap ) ) {
+ if ( array_key_exists( 'pid', $requestData ) &&
+ array_key_exists( $requestData['pid'], self::$idMap )
+ ) {
$requestData['pid'] = self::$idMap[$requestData['pid']];
}
- if ( array_key_exists( 'claimguid', $requestData ) &&
array_key_exists( $requestData['claimguid'], self::$claimGuids ) ) {
+ if ( array_key_exists( 'claimguid', $requestData ) &&
+ array_key_exists( $requestData['claimguid'],
self::$claimGuids )
+ ) {
$requestData['claimguid'] =
self::$claimGuids[$requestData['claimguid']];
}
@@ -511,7 +528,8 @@
$mock->expects( $this->any() )
->method( 'isFormatterFor' )
->will( $this->returnCallback( function ( Violation
$violation ) use ( $expectedId ) {
- $splitConstraintId = explode(
Violation::CONSTRAINT_ID_DELIMITER, $violation->getConstraintId() );
+ $splitConstraintId =
+ explode(
Violation::CONSTRAINT_ID_DELIMITER, $violation->getConstraintId() );
$prefix = $splitConstraintId[0];
return $prefix === $expectedId;
diff --git a/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
b/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
index e032eab..9c29416 100644
--- a/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
+++ b/tests/phpunit/Violations/DispatchingViolationFormatterTest.php
@@ -5,7 +5,6 @@
use WikibaseQuality\Violations\DispatchingViolationFormatter;
use WikibaseQuality\Violations\Violation;
-
/**
* @covers WikibaseQuality\Violations\DispatchingViolationFormatter
*
@@ -37,7 +36,8 @@
public function setUp() {
parent::setUp();
- $this->dispatchingViolationFormatter = new
DispatchingViolationFormatter( $this->violationFormatter );
+ $this->dispatchingViolationFormatter =
+ new DispatchingViolationFormatter(
$this->violationFormatter );
}
public function tearDown() {
@@ -120,7 +120,11 @@
/**
* @dataProvider formatAdditionalInformationDataProvider
*/
- public function testFormatAdditionalInformation( $expectedResult,
$violation, $expectedException = null ) {
+ public function testFormatAdditionalInformation(
+ $expectedResult,
+ $violation,
+ $expectedException = null
+ ) {
$this->setExpectedException( $expectedException );
$actualResult =
$this->dispatchingViolationFormatter->formatAdditionalInformation( $violation );
@@ -273,9 +277,23 @@
* @param string|null $iconClass
* @return \PHPUnit_Framework_MockObject_MockObject
*/
- private function getViolationFormatterMock( $acceptedId = null,
$additionalInformation = null, $shortMessage = null, $longMessage = null,
$iconClass = null ) {
+ private function getViolationFormatterMock(
+ $acceptedId = null,
+ $additionalInformation = null,
+ $shortMessage = null,
+ $longMessage = null,
+ $iconClass = null
+ ) {
$mock = $this->getMockBuilder(
'WikibaseQuality\Violations\ViolationFormatter' )
- ->setMethods( array( 'isFormatterFor',
'formatAdditionalInformation', 'getShortMessage', 'getLongMessage',
'getIconClass' ) )
+ ->setMethods(
+ array(
+ 'isFormatterFor',
+ 'formatAdditionalInformation',
+ 'getShortMessage',
+ 'getLongMessage',
+ 'getIconClass',
+ )
+ )
->getMockForAbstractClass();
if ( $acceptedId ) {
diff --git a/tests/phpunit/Violations/SqlViolationRepoTest.php
b/tests/phpunit/Violations/SqlViolationRepoTest.php
index 813a5f5..c1a6f05 100644
--- a/tests/phpunit/Violations/SqlViolationRepoTest.php
+++ b/tests/phpunit/Violations/SqlViolationRepoTest.php
@@ -193,7 +193,9 @@
$queryEntityId = new ViolationQuery();
$queryEntityId->setEntityId( new ItemId( 'Q84' ) );
$queryStatus = new ViolationQuery();
- $queryStatus->setStatuses( array( Violation::STATUS_EXCEPTION,
Violation::STATUS_UNVERIFIED ) );
+ $queryStatus->setStatuses(
+ array( Violation::STATUS_EXCEPTION,
Violation::STATUS_UNVERIFIED )
+ );
$queryGroup = new ViolationQuery();
$queryGroup->setConstraintGroup( 'foo' );
return array(
@@ -227,8 +229,22 @@
/**
* @dataProvider getForPageDataProvider
*/
- public function testGetForPage( $expectedResult, $query, $maxNumber,
$order, $claimGuid, $constraintId ) {
- $actualResult = $this->violationRepo->getForPage( $query,
$maxNumber, $order, $claimGuid, $constraintId );
+ public function testGetForPage(
+ $expectedResult,
+ $query,
+ $maxNumber,
+ $order,
+ $claimGuid,
+ $constraintId
+ ) {
+ $actualResult =
+ $this->violationRepo->getForPage(
+ $query,
+ $maxNumber,
+ $order,
+ $claimGuid,
+ $constraintId
+ );
$this->assertArrayEquals( $expectedResult, $actualResult );
}
@@ -328,7 +344,13 @@
/**
* @dataProvider getForPageInvalidArgumentsDataProvider
*/
- public function testGetForPageInvalidArguments( $query, $maxNumber,
$order, $claimGuid, $constraintId ) {
+ public function testGetForPageInvalidArguments(
+ $query,
+ $maxNumber,
+ $order,
+ $claimGuid,
+ $constraintId
+ ) {
$this->setExpectedException( 'InvalidArgumentException' );
$this->violationRepo->getForPage( $query, $maxNumber, $order,
$claimGuid, $constraintId );
}
@@ -475,7 +497,12 @@
/**
* @dataProvider updateDataProvider
*/
- public function testUpdate( Violation $violation, $overWriteException,
$expectedStatus, $expectedException = null ) {
+ public function testUpdate(
+ Violation $violation,
+ $overWriteException,
+ $expectedStatus,
+ $expectedException = null
+ ) {
$this->setExpectedException( $expectedException );
$this->violationRepo->update( $violation, $overWriteException );
@@ -584,7 +611,7 @@
);
$this->db->insert(
SqlViolationRepo::TABLE_NAME,
- array (
+ array(
'entity_id' =>
$violation->getEntityId()->getSerialization(),
'pid' =>
$violation->getPropertyId()->getSerialization(),
'claim_guid' => $violation->getClaimGuid(),
diff --git a/tests/phpunit/Violations/ViolationQueryTest.php
b/tests/phpunit/Violations/ViolationQueryTest.php
index db4260e..683dbfd 100644
--- a/tests/phpunit/Violations/ViolationQueryTest.php
+++ b/tests/phpunit/Violations/ViolationQueryTest.php
@@ -1,13 +1,11 @@
<?php
-
namespace WikibaseQuality\Tests\Violation;
use Wikibase\DataModel\Entity\ItemId;
use Wikibase\DataModel\Entity\PropertyId;
use WikibaseQuality\Violations\Violation;
use WikibaseQuality\Violations\ViolationQuery;
-
/**
* @covers WikibaseQuality\Violations\ViolationQuery
@@ -78,10 +76,16 @@
/**
* @dataProvider stringValueDataProvider
*/
- public function testConstraintTypeEntityId( $constraintTypeEntityId,
$expectedException = null ) {
+ public function testConstraintTypeEntityId(
+ $constraintTypeEntityId,
+ $expectedException = null
+ ) {
$this->setExpectedException( $expectedException );
$this->violationQuery->setConstraintTypeEntityId(
$constraintTypeEntityId );
- $this->assertEquals( $constraintTypeEntityId,
$this->violationQuery->getConstraintTypeEntityId() );
+ $this->assertEquals(
+ $constraintTypeEntityId,
+ $this->violationQuery->getConstraintTypeEntityId()
+ );
}
/**
diff --git a/tests/phpunit/Violations/ViolationTest.php
b/tests/phpunit/Violations/ViolationTest.php
index c9abe62..c40ca2c 100644
--- a/tests/phpunit/Violations/ViolationTest.php
+++ b/tests/phpunit/Violations/ViolationTest.php
@@ -6,7 +6,6 @@
use Wikibase\DataModel\Entity\PropertyId;
use WikibaseQuality\Violations\Violation;
-
/**
* @covers WikibaseQuality\Violations\Violation
*
@@ -20,8 +19,29 @@
/**
* @dataProvider validArgumentsProvider
*/
- public function testConstructWithValidArguments( $entityId, $pid,
$claimGuid, $constraintId, $constraintTypeEntityId, $revisionId, $status,
$additionalInfo, $updatedAt ) {
- $violation = new Violation( $entityId, $pid, $claimGuid,
$constraintId, $constraintTypeEntityId, $revisionId, $status, $additionalInfo,
$updatedAt );
+ public function testConstructWithValidArguments(
+ $entityId,
+ $pid,
+ $claimGuid,
+ $constraintId,
+ $constraintTypeEntityId,
+ $revisionId,
+ $status,
+ $additionalInfo,
+ $updatedAt
+ ) {
+ $violation =
+ new Violation(
+ $entityId,
+ $pid,
+ $claimGuid,
+ $constraintId,
+ $constraintTypeEntityId,
+ $revisionId,
+ $status,
+ $additionalInfo,
+ $updatedAt
+ );
$this->assertEquals( $entityId, $violation->getEntityId() );
$this->assertEquals( $pid, $violation->getPropertyId() );
@@ -79,10 +99,30 @@
/**
* @dataProvider invalidArgumentsProvider
*/
- public function testConstructWithInvalidArguments( $entityId, $pid,
$claimGuid, $constraintId, $constraintTypeEntityId, $revisionId, $status,
$additionalInfo, $updatedAt ) {
+ public function testConstructWithInvalidArguments(
+ $entityId,
+ $pid,
+ $claimGuid,
+ $constraintId,
+ $constraintTypeEntityId,
+ $revisionId,
+ $status,
+ $additionalInfo,
+ $updatedAt
+ ) {
$this->setExpectedException( 'InvalidArgumentException' );
- new Violation( $entityId, $pid, $claimGuid, $constraintId,
$constraintTypeEntityId, $revisionId, $status, $additionalInfo, $updatedAt );
+ new Violation(
+ $entityId,
+ $pid,
+ $claimGuid,
+ $constraintId,
+ $constraintTypeEntityId,
+ $revisionId,
+ $status,
+ $additionalInfo,
+ $updatedAt
+ );
}
public function invalidArgumentsProvider() {
diff --git a/tests/phpunit/WikibaseQualityServicesTest.php
b/tests/phpunit/WikibaseQualityServicesTest.php
index d353c3e..4955b0c 100644
--- a/tests/phpunit/WikibaseQualityServicesTest.php
+++ b/tests/phpunit/WikibaseQualityServicesTest.php
@@ -68,7 +68,9 @@
$this->setExpectedException( 'UnexpectedValueException' );
$subExtensions = array(
'foo' => array(
- 'violationFormatter' => function() { return
'foobar'; }
+ 'violationFormatter' => function () {
+ return 'foobar';
+ },
)
);
$this->setMwGlobals( 'wbqSubExtensions', $subExtensions );
@@ -81,7 +83,9 @@
public function testGetViolationTypes( $expectedResult, $subExtensionId
= null ) {
$subExtensions = array(
'foo' => array(
- 'violationTypes' => function() { return array(
'foo', 'bar' ); }
+ 'violationTypes' => function () {
+ return array( 'foo', 'bar' );
+ },
),
'bar' => array(
'violationTypes' => array( 'fubar' )
@@ -141,7 +145,9 @@
array(
array(
'foo' => array(
- 'violationTypes' => function()
{ return 'foobar'; }
+ 'violationTypes' => function ()
{
+ return 'foobar';
+ },
)
)
)
--
To view, visit https://gerrit.wikimedia.org/r/231525
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1bbaa5444cef21d2be5e5a3b218038090b2fae15
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseQuality
Gerrit-Branch: master
Gerrit-Owner: Addshore <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits