Skip to content

Commit 9c1655c

Browse files
committed
Bug: TestCase was not executable in a Laravel 5.3 installation
1 parent f04060c commit 9c1655c

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

tests/PanicHDTestCase.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,22 @@
22

33
namespace PanicHD\PanicHD\Tests;
44

5+
use Illuminate\Contracts\Console\Kernel;
6+
use Illuminate\Foundation\Testing\TestCase;
57
use PanicHD\PanicHD\Controllers\InstallController;
68
use PanicHD\PanicHD\Models\Member;
79
use PanicHD\PanicHD\Models\Setting;
810

9-
abstract class PanicHDTestCase extends \PHPUnit_Framework_TestCase
11+
abstract class PanicHDTestCase extends TestCase
1012
{
11-
// Package general status
13+
/**
14+
* The base URL to use while testing the application.
15+
*
16+
* @var string
17+
*/
18+
protected $baseUrl = 'http://localhost';
19+
20+
// Package general status
1221
protected $status = "Not installed";
1322

1423
// Main route
@@ -19,6 +28,21 @@ abstract class PanicHDTestCase extends \PHPUnit_Framework_TestCase
1928

2029
// Eloquent reusable builder for Member Tickets
2130
protected $member_tickets_builder;
31+
32+
/**
33+
* Creates the application.
34+
*
35+
* @return \Illuminate\Foundation\Application
36+
*/
37+
public function createApplication()
38+
{
39+
$laravel_root = __DIR__ . '/../../../../';
40+
$app = require $laravel_root . 'bootstrap/app.php';
41+
42+
$app->make(Kernel::class)->bootstrap();
43+
44+
return $app;
45+
}
2246

2347
/*
2448
* Load a basic vars set for package tests

0 commit comments

Comments
 (0)