Skip to content

Commit 66bcde1

Browse files
committed
test: normalize persistence paths on windows
1 parent ba09530 commit 66bcde1

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/Persistence/PersistEditorUpdatesTest.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,11 @@ function fullPageEditorData(array $data): FullPageEditorData
520520
$handleUpdates = Mockery::mock(HandleUpdates::class);
521521
$handleUpdates->shouldReceive('execute')
522522
->once()
523-
->with($absoluteTemplatePath, Mockery::type(UpdateRequest::class), ['main'])
523+
->with(
524+
Mockery::on(fn (string $path) => str_replace('\\', '/', $path) === str_replace('\\', '/', $absoluteTemplatePath)),
525+
Mockery::type(UpdateRequest::class),
526+
['main']
527+
)
524528
->andReturn(['updated' => true, 'data' => $current]);
525529

526530
persistEditorUpdatesWith($handleUpdates)->handle(editorUpdateData([
@@ -570,7 +574,11 @@ function fullPageEditorData(array $data): FullPageEditorData
570574
$handleUpdates = Mockery::mock(HandleUpdates::class);
571575
$handleUpdates->shouldReceive('execute')
572576
->once()
573-
->with($absoluteRegionPath, Mockery::type(UpdateRequest::class), ['header'])
577+
->with(
578+
Mockery::on(fn (string $path) => str_replace('\\', '/', $path) === str_replace('\\', '/', $absoluteRegionPath)),
579+
Mockery::type(UpdateRequest::class),
580+
['header']
581+
)
574582
->andReturn(['updated' => true, 'data' => $current]);
575583

576584
persistEditorUpdatesWith($handleUpdates)->handle(editorUpdateData([

0 commit comments

Comments
 (0)