From dae7861f54cb209d7c003dac1f554eb7261ae306 Mon Sep 17 00:00:00 2001 From: meili-bot <74670311+meili-bot@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:55:35 +0100 Subject: [PATCH 1/5] Update README.md From f663cf7ec7ac342c92c9c1557aa16bcdf6d0a4f5 Mon Sep 17 00:00:00 2001 From: Strift Date: Fri, 4 Apr 2025 13:10:26 +0800 Subject: [PATCH 2/5] Fix serializationTest testSimpleEntityToSearchableArray --- tests/Unit/SerializationTest.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Unit/SerializationTest.php b/tests/Unit/SerializationTest.php index 631542b..eec1911 100644 --- a/tests/Unit/SerializationTest.php +++ b/tests/Unit/SerializationTest.php @@ -16,9 +16,7 @@ public function testSimpleEntityToSearchableArray(): void { $post = new Post('a simple post', 'some text', $datetime = new \DateTimeImmutable('@1728994403')); $idReflection = (new \ReflectionObject($post))->getProperty('id'); - if (PHP_VERSION_ID < 80000) { - $idReflection->setAccessible(true); - } + $idReflection->setAccessible(true); $idReflection->setValue($post, 12); $comment = new Comment($post, 'a great comment', $datetime); From f0e4b4572398ed8f97f10b672a9c710dfb045ad2 Mon Sep 17 00:00:00 2001 From: Strift Date: Fri, 4 Apr 2025 13:19:00 +0800 Subject: [PATCH 3/5] Update filterable attributes tests --- tests/Integration/Command/MeilisearchCreateCommandTest.php | 6 +++++- tests/Integration/Command/MeilisearchImportCommandTest.php | 6 +++++- tests/Integration/SettingsTest.php | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/Integration/Command/MeilisearchCreateCommandTest.php b/tests/Integration/Command/MeilisearchCreateCommandTest.php index 2f2398f..6a658f4 100644 --- a/tests/Integration/Command/MeilisearchCreateCommandTest.php +++ b/tests/Integration/Command/MeilisearchCreateCommandTest.php @@ -133,7 +133,11 @@ public function testWithDynamicSettings(): void $getSetting = static fn ($value) => $value instanceof \IteratorAggregate ? iterator_to_array($value) : $value; - self::assertSame(['publishedAt', 'title'], $getSetting($settings['filterableAttributes'])); + $filterableAttributes = $getSetting($settings['filterableAttributes']); + sort($filterableAttributes); + $expected = ['publishedAt', 'title']; + sort($expected); + self::assertSame($expected, $filterableAttributes); self::assertSame(['title'], $getSetting($settings['searchableAttributes'])); self::assertSame(['a', 'n', 'the'], $getSetting($settings['stopWords'])); self::assertSame(['fantastic' => ['great'], 'great' => ['fantastic']], $getSetting($settings['synonyms'])); diff --git a/tests/Integration/Command/MeilisearchImportCommandTest.php b/tests/Integration/Command/MeilisearchImportCommandTest.php index 052bced..858269a 100644 --- a/tests/Integration/Command/MeilisearchImportCommandTest.php +++ b/tests/Integration/Command/MeilisearchImportCommandTest.php @@ -406,7 +406,11 @@ public function testImportWithDynamicSettings(): void $getSetting = static fn ($value) => $value instanceof \IteratorAggregate ? iterator_to_array($value) : $value; - self::assertSame(['publishedAt', 'title'], $getSetting($settings['filterableAttributes'])); + $filterableAttributes = $getSetting($settings['filterableAttributes']); + sort($filterableAttributes); + $expected = ['publishedAt', 'title']; + sort($expected); + self::assertSame($expected, $filterableAttributes); self::assertSame(['title'], $getSetting($settings['searchableAttributes'])); self::assertSame(['a', 'n', 'the'], $getSetting($settings['stopWords'])); self::assertSame(['fantastic' => ['great'], 'great' => ['fantastic']], $getSetting($settings['synonyms'])); diff --git a/tests/Integration/SettingsTest.php b/tests/Integration/SettingsTest.php index 135a23b..375e2ea 100644 --- a/tests/Integration/SettingsTest.php +++ b/tests/Integration/SettingsTest.php @@ -53,7 +53,11 @@ public function testUpdateSettings(): void $this->assertSame(1500, $settings['searchCutoffMs']); $this->assertStringContainsString('Setting "filterableAttributes" updated of "sf_phpunit__posts".', $output); - $this->assertSame(['publishedAt', 'title'], $settings['filterableAttributes']); + $filterableAttributes = $settings['filterableAttributes']; + sort($filterableAttributes); + $expected = ['publishedAt', 'title']; + sort($expected); + $this->assertSame($expected, $filterableAttributes); $this->assertStringContainsString('Setting "typoTolerance" updated of "sf_phpunit__posts".', $output); $this->assertArrayHasKey('typoTolerance', $settings); From 67a423d072030783a7c0f220ffb1a2ec7cefe237 Mon Sep 17 00:00:00 2001 From: Strift Date: Fri, 4 Apr 2025 13:34:11 +0800 Subject: [PATCH 4/5] Use the same exclusion matrix as tests.yml --- .github/workflows/pre-release-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/pre-release-tests.yml b/.github/workflows/pre-release-tests.yml index cfe0e1c..8d98a79 100644 --- a/.github/workflows/pre-release-tests.yml +++ b/.github/workflows/pre-release-tests.yml @@ -60,6 +60,12 @@ jobs: sf-version: '5.4' - php-version: '8.4' sf-version: '5.4' + - php-version: '7.4' + sf-version: '7.2' + - php-version: '8.0' + sf-version: '7.2' + - php-version: '8.1' + sf-version: '7.2' name: integration-tests-against-rc (PHP ${{ matrix.php-version }}) (Symfony ${{ matrix.sf-version }}.*) steps: From 8eac0cc6898d57c22ae09411086d97739cee99bd Mon Sep 17 00:00:00 2001 From: Strift Date: Tue, 8 Apr 2025 10:01:15 +0800 Subject: [PATCH 5/5] Add PHP version check back --- tests/Unit/SerializationTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Unit/SerializationTest.php b/tests/Unit/SerializationTest.php index eec1911..631542b 100644 --- a/tests/Unit/SerializationTest.php +++ b/tests/Unit/SerializationTest.php @@ -16,7 +16,9 @@ public function testSimpleEntityToSearchableArray(): void { $post = new Post('a simple post', 'some text', $datetime = new \DateTimeImmutable('@1728994403')); $idReflection = (new \ReflectionObject($post))->getProperty('id'); - $idReflection->setAccessible(true); + if (PHP_VERSION_ID < 80000) { + $idReflection->setAccessible(true); + } $idReflection->setValue($post, 12); $comment = new Comment($post, 'a great comment', $datetime);