Skip to content

Commit 4480b87

Browse files
committed
fix test
1 parent b2b4700 commit 4480b87

File tree

4 files changed

+17
-20
lines changed

4 files changed

+17
-20
lines changed

src/Services/SearchCode/PhpParserService.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
use Symfony\Component\Finder\Finder;
2121
use Symfony\Component\Finder\SplFileInfo;
2222

23-
use function Orchestra\Testbench\package_path;
24-
2523
class PhpParserService implements SearchCodeServiceInterface
2624
{
2725
public ?SearchCodeCache $cache = null;
@@ -210,7 +208,6 @@ public function translationsByFiles(): array
210208
}
211209

212210
$relativePath = str($path)
213-
->after(package_path())
214211
->after(base_path())
215212
->value();
216213

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-
0 => '/tests/src/app/DummyClass.php',
38+
$this->getAppPath().'/DummyClass.php',
3939
],
4040
],
4141
'messages.dummy.component' => [
4242
'count' => 1,
4343
'files' => [
44-
0 => '/tests/src/resources/components/dummy-component.blade.php',
44+
$this->getResourcesPath().'/components/dummy-component.blade.php',
4545
],
4646
],
4747
'messages.dummy.nested' => [
4848
'count' => 1,
4949
'files' => [
50-
0 => '/tests/src/resources/views/dummy-view.blade.php',
50+
$this->getResourcesPath().'/views/dummy-view.blade.php',
5151
],
5252
],
5353
'messages.dummy.view' => [
5454
'count' => 3,
5555
'files' => [
56-
0 => '/tests/src/resources/components/dummy-component.blade.php',
57-
1 => '/tests/src/resources/views/dummy-view.blade.php',
56+
$this->getResourcesPath().'/components/dummy-component.blade.php',
57+
$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 => '/tests/src/resources/views/dummy-view.blade.php',
49+
0 => $this->getResourcesPath().'/views/dummy-view.blade.php',
5050
],
5151
],
5252
]);

tests/Unit/PhpParserServiceTest.php

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

6666
expect($service->translationsByFiles())->toBe([
67-
'/tests/src/app/DummyClass.php' => [
67+
$appPath.'/DummyClass.php' => [
6868
'messages.dummy.class',
6969
],
70-
'/tests/src/resources/components/dummy-component.blade.php' => [
70+
$resourcesPath.'/components/dummy-component.blade.php' => [
7171
'messages.dummy.component',
7272
'messages.dummy.view',
7373
],
74-
'/tests/src/resources/views/dummy-view.blade.php' => [
74+
$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-
'/tests/src/resources/views/dummy-view.blade.php',
100+
$resourcesPath.'/views/dummy-view.blade.php',
101101
],
102102
],
103103
'messages.dummy.class' => [
104104
'count' => 1,
105105
'files' => [
106-
'/tests/src/app/DummyClass.php',
106+
$appPath.'/DummyClass.php',
107107
],
108108
],
109109
'messages.dummy.component' => [
110110
'count' => 1,
111111
'files' => [
112-
'/tests/src/resources/components/dummy-component.blade.php',
112+
$resourcesPath.'/components/dummy-component.blade.php',
113113
],
114114
],
115115
'messages.dummy.nested' => [
116116
'count' => 1,
117117
'files' => [
118-
'/tests/src/resources/views/dummy-view.blade.php',
118+
$resourcesPath.'/views/dummy-view.blade.php',
119119
],
120120
],
121121
'messages.dummy.view' => [
122122
'count' => 3,
123123
'files' => [
124-
'/tests/src/resources/components/dummy-component.blade.php',
125-
'/tests/src/resources/views/dummy-view.blade.php',
124+
$resourcesPath.'/components/dummy-component.blade.php',
125+
$resourcesPath.'/views/dummy-view.blade.php',
126126
],
127127
],
128128

@@ -143,11 +143,11 @@
143143
cachePath: Storage::fake('cache')
144144
);
145145

146-
$service->cache->put('/tests/src/app/DummyClass.php', [
146+
$service->cache->put('/DummyClass.php', [
147147
'messages.dummy.class',
148148
]);
149149

150-
$result = $service->cache->get('/tests/src/app/DummyClass.php');
150+
$result = $service->cache->get('/DummyClass.php');
151151

152152
expect($result['created_at'])->toBeInt();
153153

0 commit comments

Comments
 (0)