dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rdbms: Database::selectDB() update the domain and handle failure better
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
db
/
LBFactoryTest.php
diff --git
a/tests/phpunit/includes/db/LBFactoryTest.php
b/tests/phpunit/includes/db/LBFactoryTest.php
index
1616139
..
e84998c
100644
(file)
--- a/
tests/phpunit/includes/db/LBFactoryTest.php
+++ b/
tests/phpunit/includes/db/LBFactoryTest.php
@@
-608,7
+608,15
@@
class LBFactoryTest extends MediaWikiTestCase {
$this->assertFalse( $db->isOpen() );
} else {
\Wikimedia\suppressWarnings();
$this->assertFalse( $db->isOpen() );
} else {
\Wikimedia\suppressWarnings();
- $this->assertFalse( $db->selectDB( 'garbage-db' ) );
+ try {
+ $this->assertFalse( $db->selectDB( 'garbage-db' ) );
+ $this->fail( "No error thrown." );
+ } catch ( \Wikimedia\Rdbms\DBExpectedError $e ) {
+ $this->assertEquals(
+ "Could not select database 'garbage-db'.",
+ $e->getMessage()
+ );
+ }
\Wikimedia\restoreWarnings();
}
}
\Wikimedia\restoreWarnings();
}
}