Jeroen De Dauw has uploaded a new change for review.
https://gerrit.wikimedia.org/r/58084
Change subject: make use of assertContainsOnlyInstancesOf
......................................................................
make use of assertContainsOnlyInstancesOf
Change-Id: I8b214a25312460dd6613f771dcc67c7cc0bb9540
---
M DataTypes/tests/includes/DataTypeTest.php
1 file changed, 3 insertions(+), 12 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DataValues
refs/changes/84/58084/1
diff --git a/DataTypes/tests/includes/DataTypeTest.php
b/DataTypes/tests/includes/DataTypeTest.php
index dcbca1c..07f41fc 100644
--- a/DataTypes/tests/includes/DataTypeTest.php
+++ b/DataTypes/tests/includes/DataTypeTest.php
@@ -70,10 +70,7 @@
*/
public function testGetParser( DataType $type ) {
$this->assertInternalType( 'array', $type->getParsers() );
-
- foreach ( $type->getParsers() as $parser ) {
- $this->assertInstanceOf( 'ValueParsers\ValueParser',
$parser );
- }
+ $this->assertContainsOnlyInstancesOf(
'ValueParsers\ValueParser', $type->getParsers() );
}
/**
@@ -82,10 +79,7 @@
*/
public function testGetFormatter( DataType $type ) {
$this->assertInternalType( 'array', $type->getFormatters() );
-
- foreach ( $type->getFormatters() as $formatter ) {
- $this->assertInstanceOf(
'ValueFormatters\ValueFormatter', $formatter );
- }
+ $this->assertContainsOnlyInstancesOf(
'ValueFormatters\ValueFormatter', $type->getFormatters() );
}
/**
@@ -94,10 +88,7 @@
*/
public function testGetValidators( DataType $type ) {
$this->assertInternalType( 'array', $type->getValidators() );
-
- foreach ( $type->getValidators() as $validator ) {
- $this->assertInstanceOf(
'ValueValidators\ValueValidator', $validator );
- }
+ $this->assertContainsOnlyInstancesOf(
'ValueValidators\ValueValidator', $type->getValidators() );
}
/**
--
To view, visit https://gerrit.wikimedia.org/r/58084
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8b214a25312460dd6613f771dcc67c7cc0bb9540
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DataValues
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits