Skip to content

Commit

Permalink
Merge branch 'statamic-5' of github.com:statamic/migrator into statam…
Browse files Browse the repository at this point in the history
…ic-5
  • Loading branch information
duncanmcclean committed May 3, 2024
2 parents 0f63110 + 9d6c3bf commit 04d3546
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
6 changes: 3 additions & 3 deletions tests/MigrateSettingsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 12 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 04d3546

Please sign in to comment.