mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 23:44:03 +00:00
wip
This commit is contained in:
parent
3174256bd2
commit
6ed68dfd7f
4 changed files with 69 additions and 6 deletions
36
tests/Features/TenantRedirectMacroTest.php
Normal file
36
tests/Features/TenantRedirectMacroTest.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Tests\Feature;
|
||||
|
||||
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');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue