From 76e81c0835e2e694e98e5ce86a749d0833e60c69 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Thu, 2 May 2024 12:09:27 -0400 Subject: [PATCH 1/3] Upgrade php-cs-fixer version. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 507f509..a8da4f7 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "statamic/migrator", "type": "statamic-addon", "require": { - "friendsofphp/php-cs-fixer": "^3.16.0", + "friendsofphp/php-cs-fixer": "^3.54.0", "league/flysystem-aws-s3-v3": "~1.0 || ~3.0", "mustangostang/spyc": "dev-master#dfd9aadc1f5224065d55b42b712c7e99a50a3f4d" }, From 806058471d91befb20567b38b9420a83503953cb Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Thu, 2 May 2024 12:23:44 -0400 Subject: [PATCH 2/3] Windoes woes. --- tests/TestCase.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/TestCase.php b/tests/TestCase.php index 34f83bc..2cd5982 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -154,6 +154,18 @@ public static function assertStringContainsStringWithNormalizedLineEndings($need ); } + /** + * Normalize line endings before performing assertion in windows. + */ + public static function assertSameWithNormalizedLineEndings($needle, $haystack, $message = ''): void + { + static::assertSame( + static::normalizeMultilineString($needle), + static::normalizeMultilineString($haystack), + $message + ); + } + /** * @deprecated */ From 9d6c3bf9f3bd1257f88788bfdb10b87685907e85 Mon Sep 17 00:00:00 2001 From: Jesse Leite Date: Thu, 2 May 2024 12:24:04 -0400 Subject: [PATCH 3/3] Pass tests? --- tests/MigrateSettingsTest.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/MigrateSettingsTest.php b/tests/MigrateSettingsTest.php index 761c40a..e86a69d 100644 --- a/tests/MigrateSettingsTest.php +++ b/tests/MigrateSettingsTest.php @@ -165,7 +165,7 @@ public function it_migrates_system_settings() { $this->artisan('statamic:migrate:settings', ['handle' => 'system']); - $this->assertSame(File::get(resource_path('sites.yaml')), + $this->assertSameWithNormalizedLineEndings(File::get(resource_path('sites.yaml')), 'default: name: English locale: en_US @@ -191,7 +191,7 @@ public function it_migrates_multiple_locales_with_env_references() $this->artisan('statamic:migrate:settings', ['handle' => 'system']); - $this->assertSame(File::get(resource_path('sites.yaml')), + $this->assertSameWithNormalizedLineEndings(File::get(resource_path('sites.yaml')), "default: name: English locale: en_US @@ -210,7 +210,7 @@ public function it_migrates_missing_locales_using_v2_default() $this->artisan('statamic:migrate:settings', ['handle' => 'system']); - $this->assertSame(File::get(resource_path('sites.yaml')), + $this->assertSameWithNormalizedLineEndings(File::get(resource_path('sites.yaml')), 'default: name: English locale: en_US