Hashar has uploaded a new change for review.
https://gerrit.wikimedia.org/r/64036
Change subject: Tweak ApiClientInfoTest::testGetUrlInfo
......................................................................
Tweak ApiClientInfoTest::testGetUrlInfo
assertTrue() is evil since whenever it fails it gives meaningless output
such as:
Failed asserting that false is true.
is_string() can be replaced by the assertInternalType() which will
provide a meaningful output such as:
$this->assertInternalType('string', 42);
// Failed asserting that 42 is of type "string".
Change-Id: Ic14eec5c5281c96c53079af3ec22786f912aee18
---
M client/tests/phpunit/includes/api/ApiClientInfoTest.php
1 file changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/36/64036/1
diff --git a/client/tests/phpunit/includes/api/ApiClientInfoTest.php
b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
index c61c6c8..3294e26 100644
--- a/client/tests/phpunit/includes/api/ApiClientInfoTest.php
+++ b/client/tests/phpunit/includes/api/ApiClientInfoTest.php
@@ -59,9 +59,12 @@
$this->assertArrayHasKey( 'scriptpath', $urlInfo );
$this->assertArrayHasKey( 'articlepath', $urlInfo );
- $this->assertTrue( is_string( $urlInfo['base'] ) );
- $this->assertTrue( is_string( $urlInfo['scriptpath'] ) );
- $this->assertTrue( is_string( $urlInfo['articlepath'] ) );
+ $this->assertInternalType( 'string', $urlInfo['base'],
+ "The repo URL information for 'base' should be a
string" );
+ $this->assertInternalType( 'string', $urlInfo['scriptpath'],
+ "The repo URL information for 'scriptpath' should be a
string" );
+ $this->assertInternalType( 'string', $urlInfo['articlepath'],
+ "The repo URL information for 'articlepath' should be a
string" );
$this->assertEquals( \Wikibase\Settings::get( 'repoUrl' ),
$urlInfo['base'] );
$this->assertEquals( \Wikibase\Settings::get( 'repoScriptPath'
), $urlInfo['scriptpath'] );
--
To view, visit https://gerrit.wikimedia.org/r/64036
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic14eec5c5281c96c53079af3ec22786f912aee18
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits