Daniel Kinzler has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/399679 )
Change subject: Typehint against IDatabase, nto DatabaseBase
......................................................................
Typehint against IDatabase, nto DatabaseBase
Change-Id: Ia94fcae2a1dd28761b4e2f40fa1491f8401ad491
---
M tests/phpunit/EchoDbFactoryTest.php
1 file changed, 6 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo
refs/changes/79/399679/1
diff --git a/tests/phpunit/EchoDbFactoryTest.php
b/tests/phpunit/EchoDbFactoryTest.php
index dc5379c..9180f84 100644
--- a/tests/phpunit/EchoDbFactoryTest.php
+++ b/tests/phpunit/EchoDbFactoryTest.php
@@ -1,5 +1,8 @@
<?php
+use Wikimedia\Rdbms\IDatabase;
+use Wikimedia\Rdbms\ILoadBalancer;
+
class MWEchoDbFactoryTest extends MediaWikiTestCase {
public function testNewFromDefault() {
@@ -13,8 +16,8 @@
* @depends testNewFromDefault
*/
public function testGetEchoDb( MWEchoDbFactory $db ) {
- $this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb(
DB_MASTER ) );
- $this->assertInstanceOf( 'DatabaseBase', $db->getEchoDb(
DB_REPLICA ) );
+ $this->assertInstanceOf( IDatabase::class, $db->getEchoDb(
DB_MASTER ) );
+ $this->assertInstanceOf( IDatabase::class, $db->getEchoDb(
DB_REPLICA ) );
}
/**
@@ -24,7 +27,7 @@
$reflection = new ReflectionClass( 'MWEchoDbFactory' );
$method = $reflection->getMethod( 'getLB' );
$method->setAccessible( true );
- $this->assertInstanceOf( 'LoadBalancer', $method->invoke( $db )
);
+ $this->assertInstanceOf( ILoadBalancer::class, $method->invoke(
$db ) );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/399679
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia94fcae2a1dd28761b4e2f40fa1491f8401ad491
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits