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

Improve HTTP tests with custom assertion method

This commit is contained in:
Samuel Štancl 2020-05-10 19:53:34 +02:00
parent f328fc9c08
commit cb2bd018aa
2 changed files with 12 additions and 3 deletions

View file

@ -4,7 +4,8 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Tests;
use Illuminate\Support\Facades\Redis;
use Illuminate\Testing\Assert as PHPUnit;
use Illuminate\Testing\TestResponse;
use Stancl\Tenancy\Tenant;
abstract class TestCase extends \Orchestra\Testbench\TestCase
@ -37,6 +38,14 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
if ($this->autoInitTenancy) {
$this->initTenancy();
}
TestResponse::macro('assertContent', function ($content) {
/** @var TestResponse $this */
PHPUnit::assertSame($content, $this->baseResponse->getContent());
return $this;
});
}
public function createTenant($domains = ['test.localhost'])