jenkins-bot has submitted this change and it was merged.
Change subject: Add test for handling invalid fields in TermIndexEntry's
constructor
......................................................................
Add test for handling invalid fields in TermIndexEntry's constructor
Change-Id: I3e244950bf6adecceb069e61c838e3e611e0959d
---
M lib/tests/phpunit/TermIndexEntryTest.php
1 file changed, 5 insertions(+), 0 deletions(-)
Approvals:
Thiemo Mättig (WMDE): Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/tests/phpunit/TermIndexEntryTest.php
b/lib/tests/phpunit/TermIndexEntryTest.php
index 9b4db83..68779ce 100644
--- a/lib/tests/phpunit/TermIndexEntryTest.php
+++ b/lib/tests/phpunit/TermIndexEntryTest.php
@@ -66,6 +66,11 @@
$this->assertEquals( isset( $fields['termText'] ) ?
$fields['termText'] : null, $term->getText() );
}
+ public function testGivenInvalidField_constructorThrowsException() {
+ $this->setExpectedException( MWException::class );
+ new TermIndexEntry( [ 'fooField' => 'bar' ] );
+ }
+
public function testClone() {
$term = new TermIndexEntry( [ 'termText' => 'Foo' ] );
--
To view, visit https://gerrit.wikimedia.org/r/322918
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3e244950bf6adecceb069e61c838e3e611e0959d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: WMDE-leszek <[email protected]>
Gerrit-Reviewer: Daniel Kinzler <[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