1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 17:54:03 +00:00
This commit is contained in:
Samuel Štancl 2019-11-04 12:24:20 +01:00
parent 3174256bd2
commit 6ed68dfd7f
4 changed files with 69 additions and 6 deletions

View file

@ -1,36 +0,0 @@
<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Tests;
use Route;
use Stancl\Tenancy\Tenant;
class TenantRedirectMacroTest extends TestCase
{
public $autoCreateTenant = false;
public $autoInitTenancy = false;
/** @test */
public function tenant_redirect_macro_replaces_only_the_hostname()
{
config([
'tenancy.features' => ['Stancl\Tenancy\Features\TenantRedirect'],
]);
Route::get('/foobar', function () {
return 'Foo';
})->name('home');
Route::get('/redirect', function () {
return redirect()->route('home')->tenant('abcd');
});
Tenant::create('foo.localhost');
tenancy()->init('foo.localhost');
$this->get('/redirect')
->assertRedirect('http://abcd/foobar');
}
}