aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/filerepo/file
diff options
context:
space:
mode:
authorAmir Sarabadani <ladsgroup@gmail.com>2023-09-21 18:37:37 +0200
committerDannyS712 <dannys712.wiki@gmail.com>2023-09-21 18:30:37 +0000
commitabbb4281cb18560865b2491affab074fd9aa7a0a (patch)
treede9704537db3b5939f7d5d538572c5f35e5e551d /tests/phpunit/includes/filerepo/file
parentb286f79f5d41fde7f9223fdb47b675b45e20b0f9 (diff)
downloadmediawikicore-abbb4281cb18560865b2491affab074fd9aa7a0a.tar.gz
mediawikicore-abbb4281cb18560865b2491affab074fd9aa7a0a.zip
tests: Migrate more cases to SQB
Bug: T344971 Change-Id: Ia69d82d6a6e623b9032240dc910fb47ff5887661
Diffstat (limited to 'tests/phpunit/includes/filerepo/file')
-rw-r--r--tests/phpunit/includes/filerepo/file/LocalFileTest.php16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/phpunit/includes/filerepo/file/LocalFileTest.php b/tests/phpunit/includes/filerepo/file/LocalFileTest.php
index 4d043a9dfcac..2c8a7725fe44 100644
--- a/tests/phpunit/includes/filerepo/file/LocalFileTest.php
+++ b/tests/phpunit/includes/filerepo/file/LocalFileTest.php
@@ -962,8 +962,12 @@ class LocalFileTest extends MediaWikiIntegrationTestCase {
$file->load();
$file->maybeUpgradeRow();
- $metadata = $dbw->decodeBlob( $dbw->selectField( 'image', 'img_metadata',
- [ 'img_name' => 'Test.pdf' ], __METHOD__ ) );
+ $metadata = $dbw->decodeBlob( $dbw->newSelectQueryBuilder()
+ ->select( 'img_metadata' )
+ ->from( 'image' )
+ ->where( [ 'img_name' => 'Test.pdf' ] )
+ ->caller( __METHOD__ )->fetchField()
+ );
$this->assertStringMatchesFormat( $expected, $metadata );
}
@@ -1016,8 +1020,12 @@ class LocalFileTest extends MediaWikiIntegrationTestCase {
$file = new LocalFile( $title, $repo );
$file->load();
$file->maybeUpgradeRow();
- $metadata = $dbw->decodeBlob( $dbw->selectField( 'image', 'img_metadata',
- [ 'img_name' => 'Png-native-test.png' ] ) );
+ $metadata = $dbw->decodeBlob( $dbw->newSelectQueryBuilder()
+ ->select( 'img_metadata' )
+ ->from( 'image' )
+ ->where( [ 'img_name' => 'Png-native-test.png' ] )
+ ->fetchField()
+ );
// Just confirm that it looks like JSON with real metadata
$this->assertStringStartsWith( '{"data":{"frameCount":0,', $metadata );