Lucas Werkmeister (WMDE) has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/406059 )
Change subject: Add tests for two uncovered CheckResult methods ...................................................................... Add tests for two uncovered CheckResult methods Change-Id: I6a38d5068b01333349d6e98eaf370855cc13b905 --- M tests/phpunit/Result/CheckResultTest.php 1 file changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQualityConstraints refs/changes/59/406059/1 diff --git a/tests/phpunit/Result/CheckResultTest.php b/tests/phpunit/Result/CheckResultTest.php index 0c4d8fa..9566952 100644 --- a/tests/phpunit/Result/CheckResultTest.php +++ b/tests/phpunit/Result/CheckResultTest.php @@ -65,4 +65,26 @@ $checkResult->getDataValue(); } + public function testAddParameter() { + $context = new FakeSnakContext( new PropertyNoValueSnak( new PropertyId( 'P1' ) ) ); + $constraint = new Constraint( '', new PropertyId( 'P1' ), 'Q1', [] ); + $checkResult = new CheckResult( $context, $constraint ); + + $this->assertSame( [], $checkResult->getParameters() ); + + $checkResult->addParameter( 'constraint_status', 'mandatory' ); + $this->assertSame( [ 'constraint_status' => [ 'mandatory' ] ], $checkResult->getParameters() ); + } + + public function testSetStatus() { + $context = new FakeSnakContext( new PropertyNoValueSnak( new PropertyId( 'P1' ) ) ); + $constraint = new Constraint( '', new PropertyId( 'P1' ), 'Q1', [] ); + $checkResult = new CheckResult( $context, $constraint, [], CheckResult::STATUS_VIOLATION ); + + $this->assertSame( CheckResult::STATUS_VIOLATION, $checkResult->getStatus() ); + + $checkResult->setStatus( CheckResult::STATUS_WARNING ); + $this->assertSame( CheckResult::STATUS_WARNING, $checkResult->getStatus() ); + } + } -- To view, visit https://gerrit.wikimedia.org/r/406059 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6a38d5068b01333349d6e98eaf370855cc13b905 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQualityConstraints Gerrit-Branch: master Gerrit-Owner: Lucas Werkmeister (WMDE) <lucas.werkmeis...@wikimedia.de> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits