Skip to content

Commit 8161e37

Browse files
committed
fix window tests
1 parent 4762a9a commit 8161e37

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

tests/Feature/JsonDriverTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,26 @@
3535
'messages.dummy.class' => [
3636
'count' => 1,
3737
'files' => [
38-
$this->getAppPath().'/DummyClass.php',
38+
$this->formatPath($this->getAppPath().'/DummyClass.php'),
3939
],
4040
],
4141
'messages.dummy.component' => [
4242
'count' => 1,
4343
'files' => [
44-
$this->getResourcesPath().'/components/dummy-component.blade.php',
44+
$this->formatPath($this->getResourcesPath().'/components/dummy-component.blade.php'),
4545
],
4646
],
4747
'messages.dummy.nested' => [
4848
'count' => 1,
4949
'files' => [
50-
$this->getResourcesPath().'/views/dummy-view.blade.php',
50+
$this->formatPath($this->getResourcesPath().'/views/dummy-view.blade.php'),
5151
],
5252
],
5353
'messages.dummy.view' => [
5454
'count' => 3,
5555
'files' => [
56-
$this->getResourcesPath().'/components/dummy-component.blade.php',
57-
$this->getResourcesPath().'/views/dummy-view.blade.php',
56+
$this->formatPath($this->getResourcesPath().'/components/dummy-component.blade.php'),
57+
$this->formatPath($this->getResourcesPath().'/views/dummy-view.blade.php'),
5858
],
5959
],
6060
]);

tests/Feature/PhpDriverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
'This one is used.' => [
4747
'count' => 1,
4848
'files' => [
49-
0 => $this->getResourcesPath().'/views/dummy-view.blade.php',
49+
$this->formatPath($this->getResourcesPath().'/views/dummy-view.blade.php'),
5050
],
5151
],
5252
]);

tests/TestCase.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ public function getExcludedPaths(): array
2222
];
2323
}
2424

25+
public function formatPath(string ...$values): string
26+
{
27+
return str_replace(['/', '\\'], DIRECTORY_SEPARATOR, implode('', $values));
28+
}
29+
2530
public function getAppPath(): string
2631
{
2732
return __DIR__.'/src/app';

tests/Unit/PhpParserServiceTest.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@
6464
);
6565

6666
expect($service->translationsByFiles())->toBe([
67-
$appPath.'/DummyClass.php' => [
67+
$this->formatPath($appPath.'/DummyClass.php') => [
6868
'messages.dummy.class',
6969
],
70-
$resourcesPath.'/components/dummy-component.blade.php' => [
70+
$this->formatPath($resourcesPath.'/components/dummy-component.blade.php') => [
7171
'messages.dummy.component',
7272
'messages.dummy.view',
7373
],
74-
$resourcesPath.'/views/dummy-view.blade.php' => [
74+
$this->formatPath($resourcesPath.'/views/dummy-view.blade.php') => [
7575
'This one is used.',
7676
'messages.dummy.nested',
7777
'messages.dummy.view',
@@ -97,32 +97,32 @@
9797
'This one is used.' => [
9898
'count' => 1,
9999
'files' => [
100-
$resourcesPath.'/views/dummy-view.blade.php',
100+
$this->formatPath($resourcesPath.'/views/dummy-view.blade.php'),
101101
],
102102
],
103103
'messages.dummy.class' => [
104104
'count' => 1,
105105
'files' => [
106-
$appPath.'/DummyClass.php',
106+
$this->formatPath($appPath.'/DummyClass.php'),
107107
],
108108
],
109109
'messages.dummy.component' => [
110110
'count' => 1,
111111
'files' => [
112-
$resourcesPath.'/components/dummy-component.blade.php',
112+
$this->formatPath($resourcesPath.'/components/dummy-component.blade.php'),
113113
],
114114
],
115115
'messages.dummy.nested' => [
116116
'count' => 1,
117117
'files' => [
118-
$resourcesPath.'/views/dummy-view.blade.php',
118+
$this->formatPath($resourcesPath.'/views/dummy-view.blade.php'),
119119
],
120120
],
121121
'messages.dummy.view' => [
122122
'count' => 3,
123123
'files' => [
124-
$resourcesPath.'/components/dummy-component.blade.php',
125-
$resourcesPath.'/views/dummy-view.blade.php',
124+
$this->formatPath($resourcesPath.'/components/dummy-component.blade.php'),
125+
$this->formatPath($resourcesPath.'/views/dummy-view.blade.php'),
126126
],
127127
],
128128

0 commit comments

Comments
 (0)