Skip to content

Commit 9fdcff0

Browse files
test(polylang): fix font attachment query test setup
Agent-Logs-Url: https://github.com/helsingborg-stad/Municipio/sessions/26b2264a-26a1-4a7d-91fa-b5aceaa535e8 Co-authored-by: sebastianthulin <797129+sebastianthulin@users.noreply.github.com>
1 parent 955091e commit 9fdcff0

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

library/Integrations/Polylang/ResolveFontAttachmentQueriesTest.php

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ public function testAddHooksRegistersPreGetPostsAction(): void
3737
public function testMakeFontAttachmentQueryLanguageAgnosticUpdatesArrayMimeTypeQuery(): void
3838
{
3939
$query = new WP_Query();
40-
$query->query_vars = [
41-
'post_type' => 'attachment',
42-
'post_mime_type' => ['application/font-woff', 'font/woff2'],
43-
];
40+
$query->query_vars = [];
41+
$query->set('post_type', 'attachment');
42+
$query->set('post_mime_type', ['application/font-woff', 'font/woff2']);
4443

4544
$sut = $this->getSut(
4645
polylangIsActiveResolver: static fn (): bool => true
@@ -56,10 +55,9 @@ public function testMakeFontAttachmentQueryLanguageAgnosticUpdatesArrayMimeTypeQ
5655
public function testMakeFontAttachmentQueryLanguageAgnosticUpdatesStringMimeTypeQuery(): void
5756
{
5857
$query = new WP_Query();
59-
$query->query_vars = [
60-
'post_type' => 'attachment',
61-
'post_mime_type' => 'application/font-woff',
62-
];
58+
$query->query_vars = [];
59+
$query->set('post_type', 'attachment');
60+
$query->set('post_mime_type', 'application/font-woff');
6361

6462
$sut = $this->getSut(
6563
polylangIsActiveResolver: static fn (): bool => true
@@ -75,10 +73,9 @@ public function testMakeFontAttachmentQueryLanguageAgnosticUpdatesStringMimeType
7573
public function testMakeFontAttachmentQueryLanguageAgnosticDoesNotUpdateNonFontQueries(): void
7674
{
7775
$query = new WP_Query();
78-
$query->query_vars = [
79-
'post_type' => 'attachment',
80-
'post_mime_type' => 'image/jpeg',
81-
];
76+
$query->query_vars = [];
77+
$query->set('post_type', 'attachment');
78+
$query->set('post_mime_type', 'image/jpeg');
8279

8380
$sut = $this->getSut(
8481
polylangIsActiveResolver: static fn (): bool => true
@@ -94,10 +91,9 @@ public function testMakeFontAttachmentQueryLanguageAgnosticDoesNotUpdateNonFontQ
9491
public function testMakeFontAttachmentQueryLanguageAgnosticDoesNotUpdateQueriesWhenPolylangIsUnavailable(): void
9592
{
9693
$query = new WP_Query();
97-
$query->query_vars = [
98-
'post_type' => 'attachment',
99-
'post_mime_type' => 'application/font-woff',
100-
];
94+
$query->query_vars = [];
95+
$query->set('post_type', 'attachment');
96+
$query->set('post_mime_type', 'application/font-woff');
10197

10298
$sut = $this->getSut(
10399
polylangIsActiveResolver: static fn (): bool => false

0 commit comments

Comments
 (0)