Skip to content

Commit 85540d4

Browse files
committed
wip
1 parent 7700bd5 commit 85540d4

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/PackageServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function boot()
8888
}
8989

9090
foreach ($this->package->routeFileNames as $routeFileName) {
91-
$this->loadRoutesFrom($this->package->basePath('/../routes/') . $routeFileName . '.php');
91+
$this->loadRoutesFrom("{$this->package->basePath('/../routes/')}{$routeFileName}.php");
9292
}
9393

9494
$this->packageBooted();

tests/PackageServiceProviderTests/PackageRouteTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,22 @@ public function configurePackage(Package $package)
1313

1414
$package
1515
->name('laravel-package-tools')
16-
->hasRoutes(['web', 'admin']);
16+
->hasRoutes(['web', 'other']);
1717
}
1818

1919
/** @test */
2020
public function it_can_load_the_route()
2121
{
22-
$response = $this->get('/larsklopstra');
22+
$response = $this->get('my-route');
2323

24-
$response->assertSeeText('Hello Spatie!');
24+
$response->assertSeeText('my response');
2525
}
2626

2727
/** @test */
2828
public function it_can_load_multiple_route()
2929
{
30-
$adminResponse = $this->get('/admin');
30+
$adminResponse = $this->get('other-route');
3131

32-
$adminResponse->assertSeeText('Admins only');
32+
$adminResponse->assertSeeText('other response');
3333
}
3434
}

tests/TestPackage/routes/admin.php

Lines changed: 0 additions & 5 deletions
This file was deleted.

tests/TestPackage/routes/other.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
use Illuminate\Support\Facades\Route;
4+
5+
Route::get('other-route', fn () => 'other response');

tests/TestPackage/routes/web.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
use Illuminate\Support\Facades\Route;
44

5-
Route::get('larsklopstra', fn () => 'Hello Spatie!');
5+
Route::get('my-route', fn () => 'my response');

0 commit comments

Comments
 (0)