jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/359142 )
Change subject: Remove unnecessary tearDown methods
......................................................................
Remove unnecessary tearDown methods
The fields are overwritten by each setUp(), so there is no need to
unset() them in tearDown().
Change-Id: Id417b075871e7febc5400e36ca52350383970fac
---
M tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
M tests/phpunit/Checker/ConnectionChecker/ConflictsWithCheckerTest.php
M tests/phpunit/Checker/ConnectionChecker/ConnectionCheckerHelperTest.php
M tests/phpunit/Checker/ConnectionChecker/InverseCheckerTest.php
M tests/phpunit/Checker/ConnectionChecker/ItemCheckerTest.php
M tests/phpunit/Checker/ConnectionChecker/SymmetricCheckerTest.php
M tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
M tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
M tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
M tests/phpunit/Checker/QualifierChecker/MandatoryQualifiersCheckerTest.php
M tests/phpunit/Checker/QualifierChecker/QualifierCheckerTest.php
M tests/phpunit/Checker/QualifierChecker/QualifiersCheckerTest.php
M tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php
M tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
M tests/phpunit/Checker/TypeChecker/TypeCheckerTest.php
M tests/phpunit/Checker/TypeChecker/TypeSparqlCheckerTest.php
M tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
M tests/phpunit/Checker/TypeChecker/ValueTypeSparqlCheckerTest.php
M tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
M tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
M tests/phpunit/Checker/ValueCountChecker/UniqueValueCheckerTest.php
M tests/phpunit/Checker/ValueCountChecker/ValueCountCheckerHelperTest.php
M tests/phpunit/DelegatingConstraintCheckerTest.php
M tests/phpunit/Helper/ConstraintParameterParserTest.php
M tests/phpunit/Result/CheckResultTest.php
M tests/phpunit/Specials/SpecialConstraintReportTest.php
26 files changed, 0 insertions(+), 170 deletions(-)
Approvals:
Aleksey Bekh-Ivanov (WMDE): Looks good to me, approved
jenkins-bot: Verified
Thiemo Mättig (WMDE): Looks good to me, approved
diff --git
a/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
b/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
index 1509d7d..9388741 100644
--- a/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
+++ b/tests/phpunit/Checker/CommonsLinkChecker/CommonsLinkCheckerTest.php
@@ -50,12 +50,6 @@
$this->tablesUsed[] = 'image';
}
- protected function tearDown() {
- unset( $this->helper );
- unset( $this->commonsLinkChecker );
- parent::tearDown();
- }
-
public function addDBData() {
$this->db->delete( 'image', '*' );
$this->db->insert(
diff --git
a/tests/phpunit/Checker/ConnectionChecker/ConflictsWithCheckerTest.php
b/tests/phpunit/Checker/ConnectionChecker/ConflictsWithCheckerTest.php
index 8829c04..3ae5487 100644
--- a/tests/phpunit/Checker/ConnectionChecker/ConflictsWithCheckerTest.php
+++ b/tests/phpunit/Checker/ConnectionChecker/ConflictsWithCheckerTest.php
@@ -60,13 +60,6 @@
);
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->connectionCheckerHelper );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testConflictsWithConstraintValid() {
$entity = $this->lookup->getEntity( new ItemId( 'Q4' ) );
diff --git
a/tests/phpunit/Checker/ConnectionChecker/ConnectionCheckerHelperTest.php
b/tests/phpunit/Checker/ConnectionChecker/ConnectionCheckerHelperTest.php
index a99afd8..78706c6 100644
--- a/tests/phpunit/Checker/ConnectionChecker/ConnectionCheckerHelperTest.php
+++ b/tests/phpunit/Checker/ConnectionChecker/ConnectionCheckerHelperTest.php
@@ -48,11 +48,6 @@
$this->connectionCheckerHelper = new ConnectionCheckerHelper();
}
- protected function tearDown() {
- unset( $this->statementList );
- parent::tearDown();
- }
-
public function testHasPropertyValid() {
$this->assertTrue( $this->connectionCheckerHelper->hasProperty(
$this->statementList, 'P1' ) );
}
diff --git a/tests/phpunit/Checker/ConnectionChecker/InverseCheckerTest.php
b/tests/phpunit/Checker/ConnectionChecker/InverseCheckerTest.php
index 08314e6..d73a450 100644
--- a/tests/phpunit/Checker/ConnectionChecker/InverseCheckerTest.php
+++ b/tests/phpunit/Checker/ConnectionChecker/InverseCheckerTest.php
@@ -59,13 +59,6 @@
);
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->connectionCheckerHelper );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testInverseConstraintValid() {
$entity = $this->lookup->getEntity( new ItemId( 'Q1' ) );
diff --git a/tests/phpunit/Checker/ConnectionChecker/ItemCheckerTest.php
b/tests/phpunit/Checker/ConnectionChecker/ItemCheckerTest.php
index 82d8fb1..5adea98 100644
--- a/tests/phpunit/Checker/ConnectionChecker/ItemCheckerTest.php
+++ b/tests/phpunit/Checker/ConnectionChecker/ItemCheckerTest.php
@@ -57,13 +57,6 @@
);
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->connectionCheckerHelper );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testItemConstraintInvalid() {
$entity = $this->lookup->getEntity( new ItemId( 'Q4' ) );
$constraintParameters = [
diff --git a/tests/phpunit/Checker/ConnectionChecker/SymmetricCheckerTest.php
b/tests/phpunit/Checker/ConnectionChecker/SymmetricCheckerTest.php
index 5e265f9..856885e 100644
--- a/tests/phpunit/Checker/ConnectionChecker/SymmetricCheckerTest.php
+++ b/tests/phpunit/Checker/ConnectionChecker/SymmetricCheckerTest.php
@@ -67,14 +67,6 @@
);
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->helper );
- unset( $this->connectionCheckerHelper );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testSymmetricConstraintWithCorrectSpouse() {
$value = new EntityIdValue( new ItemId( 'Q3' ) );
$statement = new Statement( new PropertyValueSnak( new
PropertyId( 'P188' ), $value ) );
diff --git
a/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
b/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
index 291fd0a..7cef17d 100644
--- a/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
+++ b/tests/phpunit/Checker/ConnectionChecker/TargetRequiredClaimCheckerTest.php
@@ -63,13 +63,6 @@
);
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->connectionCheckerHelper );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testTargetRequiredClaimConstraintValid() {
$value = new EntityIdValue( new ItemId( 'Q5' ) );
$statement = new Statement( new PropertyValueSnak( new
PropertyId( 'P188' ), $value ) );
diff --git a/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
b/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
index a936d49..5a58a47 100644
--- a/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
+++ b/tests/phpunit/Checker/FormatChecker/FormatCheckerTest.php
@@ -47,12 +47,6 @@
$this->formatChecker = new FormatChecker( $this->helper );
}
- protected function tearDown() {
- unset( $this->helper );
- unset( $this->formatChecker );
- parent::tearDown();
- }
-
public function testFormatConstraintImdb() {
$pattern = '(tt|nm|ch|co|ev)\d{7}';
diff --git a/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
b/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
index 23b3535..39c5a87 100644
--- a/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
+++ b/tests/phpunit/Checker/OneOfChecker/OneOfCheckerTest.php
@@ -46,11 +46,6 @@
);
}
- protected function tearDown() {
- unset( $this->oneOfChecker );
- parent::tearDown();
- }
-
public function testOneOfConstraint() {
$valueIn = new EntityIdValue( new ItemId( 'Q1' ) );
$valueNotIn = new EntityIdValue( new ItemId( 'Q9' ) );
diff --git
a/tests/phpunit/Checker/QualifierChecker/MandatoryQualifiersCheckerTest.php
b/tests/phpunit/Checker/QualifierChecker/MandatoryQualifiersCheckerTest.php
index 2464651..092b31e 100644
--- a/tests/phpunit/Checker/QualifierChecker/MandatoryQualifiersCheckerTest.php
+++ b/tests/phpunit/Checker/QualifierChecker/MandatoryQualifiersCheckerTest.php
@@ -37,11 +37,6 @@
$this->lookup = new JsonFileEntityLookup( __DIR__ );
}
- protected function tearDown() {
- unset( $this->lookup );
- parent::tearDown();
- }
-
/**
* @param StatementListProvider $entity
*
diff --git a/tests/phpunit/Checker/QualifierChecker/QualifierCheckerTest.php
b/tests/phpunit/Checker/QualifierChecker/QualifierCheckerTest.php
index 1c61394..e8d7639 100644
--- a/tests/phpunit/Checker/QualifierChecker/QualifierCheckerTest.php
+++ b/tests/phpunit/Checker/QualifierChecker/QualifierCheckerTest.php
@@ -35,11 +35,6 @@
$this->lookup = new JsonFileEntityLookup( __DIR__ );
}
- protected function tearDown() {
- unset( $this->lookup );
- parent::tearDown();
- }
-
/**
* @param StatementListProvider $entity
*
diff --git a/tests/phpunit/Checker/QualifierChecker/QualifiersCheckerTest.php
b/tests/phpunit/Checker/QualifierChecker/QualifiersCheckerTest.php
index 13bcf22..14505d4 100644
--- a/tests/phpunit/Checker/QualifierChecker/QualifiersCheckerTest.php
+++ b/tests/phpunit/Checker/QualifierChecker/QualifiersCheckerTest.php
@@ -47,12 +47,6 @@
$this->lookup = new JsonFileEntityLookup( __DIR__ );
}
- protected function tearDown() {
- unset( $this->qualifiersList );
- unset( $this->lookup );
- parent::tearDown();
- }
-
/**
* @param StatementListProvider $entity
*
diff --git a/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php
b/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php
index 5fd3fc0..75ef87a 100644
--- a/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php
+++ b/tests/phpunit/Checker/RangeChecker/DiffWithinRangeCheckerTest.php
@@ -64,14 +64,6 @@
);
}
- protected function tearDown() {
- unset( $this->helper );
- unset( $this->lookup );
- unset( $this->timeValue );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testDiffWithinRangeConstraintWithinRange() {
$entity = $this->lookup->getEntity( new ItemId( 'Q4' ) );
$constraintParameters = [
diff --git a/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
b/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
index be9ef9e..ee7df6b 100644
--- a/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
+++ b/tests/phpunit/Checker/RangeChecker/RangeCheckerTest.php
@@ -68,14 +68,6 @@
);
}
- protected function tearDown() {
- unset( $this->helper );
- unset( $this->lookup );
- unset( $this->timeValue );
- unset( $this->checker );
- parent::tearDown();
- }
-
public function testRangeConstraintWithinRange() {
$value = new DecimalValue( 3.1415926536 );
$statement = new Statement( new PropertyValueSnak( new
PropertyId( 'P1457' ), new QuantityValue( $value, '1', $value, $value ) ) );
diff --git a/tests/phpunit/Checker/TypeChecker/TypeCheckerTest.php
b/tests/phpunit/Checker/TypeChecker/TypeCheckerTest.php
index 1089de8..f8a2334 100644
--- a/tests/phpunit/Checker/TypeChecker/TypeCheckerTest.php
+++ b/tests/phpunit/Checker/TypeChecker/TypeCheckerTest.php
@@ -61,12 +61,6 @@
$this->typeStatement = new Statement( new PropertyValueSnak(
new PropertyId( 'P1' ), new EntityIdValue( new ItemId( 'Q42' ) ) ) );
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->typeStatement );
- parent::tearDown();
- }
-
public function testTypeConstraintInstanceValid() {
$entity = $this->lookup->getEntity( new ItemId( 'Q1' ) );
$constraintParameters = [
diff --git a/tests/phpunit/Checker/TypeChecker/TypeSparqlCheckerTest.php
b/tests/phpunit/Checker/TypeChecker/TypeSparqlCheckerTest.php
index ab7435d..af75134 100644
--- a/tests/phpunit/Checker/TypeChecker/TypeSparqlCheckerTest.php
+++ b/tests/phpunit/Checker/TypeChecker/TypeSparqlCheckerTest.php
@@ -54,12 +54,6 @@
$this->typeStatement = new Statement( new PropertyValueSnak(
new PropertyId( 'P1' ), new EntityIdValue( new ItemId( 'Q42' ) ) ) );
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->typeStatement );
- parent::tearDown();
- }
-
// relation 'subclass'
public function testTypeConstraintSubclassValid() {
diff --git a/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
b/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
index 3175105..47230f1 100644
--- a/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
+++ b/tests/phpunit/Checker/TypeChecker/ValueTypeCheckerTest.php
@@ -66,13 +66,6 @@
$this->valueTypePropertyId = new PropertyId( 'P1234' );
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->valueTypePropertyId );
- unset( $this->valueTypeTypeChecker );
- parent::tearDown();
- }
-
public function testValueTypeConstraintInstanceValid() {
$statement = new Statement( new PropertyValueSnak(
$this->valueTypePropertyId, new EntityIdValue( new ItemId( 'Q1' ) ) ) );
$constraintParameters = [
diff --git a/tests/phpunit/Checker/TypeChecker/ValueTypeSparqlCheckerTest.php
b/tests/phpunit/Checker/TypeChecker/ValueTypeSparqlCheckerTest.php
index e29666b..acdff78 100644
--- a/tests/phpunit/Checker/TypeChecker/ValueTypeSparqlCheckerTest.php
+++ b/tests/phpunit/Checker/TypeChecker/ValueTypeSparqlCheckerTest.php
@@ -59,13 +59,6 @@
$this->typeStatement = new Statement( new PropertyValueSnak(
new PropertyId( 'P1' ), new EntityIdValue( new ItemId( 'Q42' ) ) ) );
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->typeStatement );
- unset( $this->valueTypePropertyId );
- parent::tearDown();
- }
-
// relation 'subclass'
public function testValueTypeConstraintSubclassValid() {
diff --git a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
index b1461b8..fbf3812 100644
--- a/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/MultiValueCheckerTest.php
@@ -56,14 +56,6 @@
$this->lookup = new JsonFileEntityLookup( __DIR__ );
}
- protected function tearDown() {
- unset( $this->helper );
- unset( $this->multiPropertyId );
- unset( $this->checker );
- unset( $this->lookup );
- parent::tearDown();
- }
-
public function testMultiValueConstraintOne() {
$entity = $this->lookup->getEntity( new ItemId( 'Q4' ) );
$statement = new Statement( new PropertyValueSnak(
$this->multiPropertyId, new EntityIdValue( new ItemId( 'Q207' ) ) ) );
diff --git a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
index 22800c9..7f8b1b3 100644
--- a/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/SingleValueCheckerTest.php
@@ -56,14 +56,6 @@
$this->lookup = new JsonFileEntityLookup( __DIR__ );
}
- protected function tearDown() {
- unset( $this->helper );
- unset( $this->singlePropertyId );
- unset( $this->checker );
- unset( $this->lookup );
- parent::tearDown();
- }
-
public function testSingleValueConstraintOne() {
$entity = $this->lookup->getEntity( new ItemId( 'Q1' ) );
$statement = new Statement( new PropertyValueSnak(
$this->singlePropertyId, new EntityIdValue( new ItemId( 'Q1384' ) ) ) );
diff --git a/tests/phpunit/Checker/ValueCountChecker/UniqueValueCheckerTest.php
b/tests/phpunit/Checker/ValueCountChecker/UniqueValueCheckerTest.php
index d0ee32d..a6c393e 100644
--- a/tests/phpunit/Checker/ValueCountChecker/UniqueValueCheckerTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/UniqueValueCheckerTest.php
@@ -51,12 +51,6 @@
}
- protected function tearDown() {
- unset( $this->uniquePropertyId );
- unset( $this->lookup );
- parent::tearDown();
- }
-
public function testCheckUniqueValueConstraintInvalid() {
$statement = new Statement( new PropertyValueSnak(
$this->uniquePropertyId, new EntityIdValue( new ItemId( 'Q6' ) ) ) );
$statement->setGuid( 'Q6$e35707be-4a84-61fe-9b52-623784a316a7'
);
diff --git
a/tests/phpunit/Checker/ValueCountChecker/ValueCountCheckerHelperTest.php
b/tests/phpunit/Checker/ValueCountChecker/ValueCountCheckerHelperTest.php
index 7f2e8ef..521a5ba 100644
--- a/tests/phpunit/Checker/ValueCountChecker/ValueCountCheckerHelperTest.php
+++ b/tests/phpunit/Checker/ValueCountChecker/ValueCountCheckerHelperTest.php
@@ -36,11 +36,6 @@
$this->statementList = new StatementList( [ $statement1,
$statement2, $statement3, $statement4 ] );
}
- protected function tearDown() {
- unset( $this->statementList );
- parent::tearDown();
- }
-
public function testGetPropertyCount() {
$checker = new ValueCountCheckerHelper();
$propertyCount = $checker->getPropertyCount(
$this->statementList );
diff --git a/tests/phpunit/DelegatingConstraintCheckerTest.php
b/tests/phpunit/DelegatingConstraintCheckerTest.php
index 7a758af..7dcf544 100644
--- a/tests/phpunit/DelegatingConstraintCheckerTest.php
+++ b/tests/phpunit/DelegatingConstraintCheckerTest.php
@@ -86,13 +86,6 @@
$this->tablesUsed[ ] = CONSTRAINT_TABLE;
}
- protected function tearDown() {
- unset( $this->lookup );
- unset( $this->constraintChecker );
- unset( $this->statementGuidParser );
- parent::tearDown();
- }
-
/**
* Adds temporary test data to database.
*
diff --git a/tests/phpunit/Helper/ConstraintParameterParserTest.php
b/tests/phpunit/Helper/ConstraintParameterParserTest.php
index e8a533f..38495d0 100644
--- a/tests/phpunit/Helper/ConstraintParameterParserTest.php
+++ b/tests/phpunit/Helper/ConstraintParameterParserTest.php
@@ -26,11 +26,6 @@
$this->helper = new ConstraintParameterParser();
}
- protected function tearDown() {
- parent::tearDown();
- unset( $this->helper );
- }
-
public function testParseSingleParameter() {
$parameter = 'P1';
$this->assertEquals( [ new PropertyId( $parameter ) ],
$this->helper->parseSingleParameter( $parameter ) );
diff --git a/tests/phpunit/Result/CheckResultTest.php
b/tests/phpunit/Result/CheckResultTest.php
index d58ba28..040e2f9 100644
--- a/tests/phpunit/Result/CheckResultTest.php
+++ b/tests/phpunit/Result/CheckResultTest.php
@@ -68,17 +68,6 @@
$this->message = 'All right';
}
- protected function tearDown() {
- parent::tearDown();
- unset( $this->entityId );
- unset( $this->statement );
- unset( $this->constraintName );
- unset( $this->constraintId );
- unset( $this->parameters );
- unset( $this->status );
- unset( $this->message );
- }
-
public function testConstructAndGetters() {
$checkResult = new CheckResult(
$this->entityId, $this->statement,
$this->constraintName, $this->constraintId,
diff --git a/tests/phpunit/Specials/SpecialConstraintReportTest.php
b/tests/phpunit/Specials/SpecialConstraintReportTest.php
index 87ff139..94a6fa9 100644
--- a/tests/phpunit/Specials/SpecialConstraintReportTest.php
+++ b/tests/phpunit/Specials/SpecialConstraintReportTest.php
@@ -62,10 +62,6 @@
$this->tablesUsed[ ] = CONSTRAINT_TABLE;
}
- protected function tearDown() {
- parent::tearDown();
- }
-
protected function newSpecialPage() {
$constraintReportFactory =
ConstraintReportFactory::getDefaultInstance();
$wikibaseRepo = WikibaseRepo::getDefaultInstance();
--
To view, visit https://gerrit.wikimedia.org/r/359142
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id417b075871e7febc5400e36ca52350383970fac
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints
Gerrit-Branch: master
Gerrit-Owner: Lucas Werkmeister (WMDE) <[email protected]>
Gerrit-Reviewer: Aleksey Bekh-Ivanov (WMDE) <[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