Skip to content

Commit e820aa8

Browse files
committed
fix main application tests
1 parent f3fc812 commit e820aa8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/BackpackServiceProvider.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ public function publishFiles()
163163
*/
164164
public function setupRoutes(Router $router)
165165
{
166-
if (app()->runningUnitTests()) {
167-
$this->loadRoutesFrom(__DIR__.'/routes/backpack/testing.php');
168-
169-
return;
170-
}
171166
// by default, use the routes file provided in vendor
172167
$routeFilePathInUse = __DIR__.$this->routeFilePath;
173168

tests/BaseTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Backpack\CRUD\Tests;
44

55
use Backpack\CRUD\BackpackServiceProvider;
6+
use Illuminate\Support\Facades\Route;
67
use Orchestra\Testbench\TestCase;
78

89
abstract class BaseTest extends TestCase
@@ -15,6 +16,16 @@ abstract class BaseTest extends TestCase
1516
protected function setUp(): void
1617
{
1718
parent::setUp();
19+
20+
Route::group([
21+
(array) config('backpack.base.web_middleware', 'web'),
22+
(array) config('backpack.base.middleware_key', 'admin'),
23+
'prefix' => config('backpack.base.route_prefix', 'admin'),
24+
],
25+
function () {
26+
Route::crud('users', 'Backpack\CRUD\Tests\Unit\Http\Controllers\UserCrudController');
27+
}
28+
);
1829
}
1930

2031
protected function getPackageProviders($app)

0 commit comments

Comments
 (0)