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

Testing 6.x support even for Assert

This commit is contained in:
Samuel Štancl 2020-05-13 06:39:16 +02:00
parent e1a3b1f7c9
commit c75c5b3879

View file

@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Tests;
use Illuminate\Support\Facades\Redis;
use Illuminate\Testing\Assert as PHPUnit;
use Stancl\Tenancy\Tests\Etc\Tenant;
abstract class TestCase extends \Orchestra\Testbench\TestCase
@ -32,9 +31,8 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
// 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());
$assertClass = class_exists('Illuminate\Testing\Assert') ? 'Illuminate\Testing\Assert' : 'Illuminate\Foundation\Testing\Assert';
$assertClass::assertSame($content, $this->baseResponse->getContent());
return $this;
});