Skip to content

Commit 25a5fb3

Browse files
authored
Merge pull request #380 from meilisearch/fix-tests-for-v1.14
Fix tests for v1.14
2 parents dae7861 + 8eac0cc commit 25a5fb3

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

.github/workflows/pre-release-tests.yml

+6
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ jobs:
6060
sf-version: '5.4'
6161
- php-version: '8.4'
6262
sf-version: '5.4'
63+
- php-version: '7.4'
64+
sf-version: '7.2'
65+
- php-version: '8.0'
66+
sf-version: '7.2'
67+
- php-version: '8.1'
68+
sf-version: '7.2'
6369

6470
name: integration-tests-against-rc (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }}.*)
6571
steps:

tests/Integration/Command/MeilisearchCreateCommandTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,11 @@ public function testWithDynamicSettings(): void
133133

134134
$getSetting = static fn ($value) => $value instanceof \IteratorAggregate ? iterator_to_array($value) : $value;
135135

136-
self::assertSame(['publishedAt', 'title'], $getSetting($settings['filterableAttributes']));
136+
$filterableAttributes = $getSetting($settings['filterableAttributes']);
137+
sort($filterableAttributes);
138+
$expected = ['publishedAt', 'title'];
139+
sort($expected);
140+
self::assertSame($expected, $filterableAttributes);
137141
self::assertSame(['title'], $getSetting($settings['searchableAttributes']));
138142
self::assertSame(['a', 'n', 'the'], $getSetting($settings['stopWords']));
139143
self::assertSame(['fantastic' => ['great'], 'great' => ['fantastic']], $getSetting($settings['synonyms']));

tests/Integration/Command/MeilisearchImportCommandTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,11 @@ public function testImportWithDynamicSettings(): void
406406

407407
$getSetting = static fn ($value) => $value instanceof \IteratorAggregate ? iterator_to_array($value) : $value;
408408

409-
self::assertSame(['publishedAt', 'title'], $getSetting($settings['filterableAttributes']));
409+
$filterableAttributes = $getSetting($settings['filterableAttributes']);
410+
sort($filterableAttributes);
411+
$expected = ['publishedAt', 'title'];
412+
sort($expected);
413+
self::assertSame($expected, $filterableAttributes);
410414
self::assertSame(['title'], $getSetting($settings['searchableAttributes']));
411415
self::assertSame(['a', 'n', 'the'], $getSetting($settings['stopWords']));
412416
self::assertSame(['fantastic' => ['great'], 'great' => ['fantastic']], $getSetting($settings['synonyms']));

tests/Integration/SettingsTest.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ public function testUpdateSettings(): void
5353
$this->assertSame(1500, $settings['searchCutoffMs']);
5454

5555
$this->assertStringContainsString('Setting "filterableAttributes" updated of "sf_phpunit__posts".', $output);
56-
$this->assertSame(['publishedAt', 'title'], $settings['filterableAttributes']);
56+
$filterableAttributes = $settings['filterableAttributes'];
57+
sort($filterableAttributes);
58+
$expected = ['publishedAt', 'title'];
59+
sort($expected);
60+
$this->assertSame($expected, $filterableAttributes);
5761

5862
$this->assertStringContainsString('Setting "typoTolerance" updated of "sf_phpunit__posts".', $output);
5963
$this->assertArrayHasKey('typoTolerance', $settings);

0 commit comments

Comments
 (0)