1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 15:34:03 +00:00

Laravel 6 support for testing

This commit is contained in:
Samuel Štancl 2020-05-13 06:32:07 +02:00
parent de53b81c0e
commit e1a3b1f7c9

View file

@ -6,7 +6,6 @@ namespace Stancl\Tenancy\Tests;
use Illuminate\Support\Facades\Redis;
use Illuminate\Testing\Assert as PHPUnit;
use Illuminate\Testing\TestResponse;
use Stancl\Tenancy\Tests\Etc\Tenant;
abstract class TestCase extends \Orchestra\Testbench\TestCase
@ -30,7 +29,9 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
'--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 */
PHPUnit::assertSame($content, $this->baseResponse->getContent());