mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:24:03 +00:00
Laravel 6 support for testing
This commit is contained in:
parent
de53b81c0e
commit
e1a3b1f7c9
1 changed files with 3 additions and 2 deletions
|
|
@ -6,7 +6,6 @@ namespace Stancl\Tenancy\Tests;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Redis;
|
use Illuminate\Support\Facades\Redis;
|
||||||
use Illuminate\Testing\Assert as PHPUnit;
|
use Illuminate\Testing\Assert as PHPUnit;
|
||||||
use Illuminate\Testing\TestResponse;
|
|
||||||
use Stancl\Tenancy\Tests\Etc\Tenant;
|
use Stancl\Tenancy\Tests\Etc\Tenant;
|
||||||
|
|
||||||
abstract class TestCase extends \Orchestra\Testbench\TestCase
|
abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||||
|
|
@ -30,7 +29,9 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||||
'--realpath' => true,
|
'--realpath' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
TestResponse::macro('assertContent', function ($content) {
|
// Laravel 6.x support
|
||||||
|
$testResponse = class_exists('Illuminate\Testing\TestResponse') ? 'Illuminate\Testing\TestResponse' : 'Illuminate\Foundation\Testing\TestResponse';
|
||||||
|
$testResponse::macro('assertContent', function ($content) {
|
||||||
/** @var TestResponse $this */
|
/** @var TestResponse $this */
|
||||||
|
|
||||||
PHPUnit::assertSame($content, $this->baseResponse->getContent());
|
PHPUnit::assertSame($content, $this->baseResponse->getContent());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue