aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/integration/includes/db
diff options
context:
space:
mode:
authorDreamy Jazz <wpgbrown@wikimedia.org>2024-08-09 15:10:36 +0100
committerDreamy Jazz <wpgbrown@wikimedia.org>2024-08-09 18:27:48 +0000
commit2e9414bd809c8fc3cfa901073eaa564768f92f31 (patch)
treeb735018b24aea7f4a904048b698ed14f1b6c9a96 /tests/phpunit/integration/includes/db
parentfb5f6862c00cb4a8c368b9796916b9c9b5647485 (diff)
downloadmediawikicore-2e9414bd809c8fc3cfa901073eaa564768f92f31.tar.gz
mediawikicore-2e9414bd809c8fc3cfa901073eaa564768f92f31.zip
Fix inconsistently failing testQueryTimeout test
Why: * DatabaseMysqlTest::testQueryTimeout when the query does not throw an exception, will instead expect that the result has one row with a single item of '1'. * However, this check is done against the integer which does not match when ::assertSame is used. * Converting both the expected and actual values to a string should avoid this. What: * Do this fix. Bug: T365596 Change-Id: I21ce8b6014ee66795c2555f8a0eae2e4657f844e
Diffstat (limited to 'tests/phpunit/integration/includes/db')
-rw-r--r--tests/phpunit/integration/includes/db/DatabaseMysqlTest.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/integration/includes/db/DatabaseMysqlTest.php b/tests/phpunit/integration/includes/db/DatabaseMysqlTest.php
index e54288c2cf66..c639670a125c 100644
--- a/tests/phpunit/integration/includes/db/DatabaseMysqlTest.php
+++ b/tests/phpunit/integration/includes/db/DatabaseMysqlTest.php
@@ -58,7 +58,7 @@ class DatabaseMysqlTest extends \MediaWikiIntegrationTestCase {
// if the query did not time out, there should be a single row where sleep() returned 1
$this->assertSame( 1, $res->numRows() );
$row = $res->fetchRow();
- $this->assertSame( 1, reset( $row ) );
+ $this->assertSame( '1', (string)reset( $row ) );
} catch ( DBQueryTimeoutError $e ) {
$this->assertInstanceOf( DBQueryTimeoutError::class, $e );
}