1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 10:54:04 +00:00
tenancy/tests/Features/TenantRedirectMacroTest.php
Samuel Štancl 31c9930c93
[2.2.0] Timestamps (#213)
* Timestamps

* Apply fixes from StyleCI

* Add void typehint

* wip

* Fix tests

* Apply fixes from StyleCI
2019-11-04 17:56:08 +01:00

37 lines
869 B
PHP

<?php
declare(strict_types=1);
namespace Stancl\Tenancy\Tests\Feature;
use Route;
use Stancl\Tenancy\Tenant;
use Stancl\Tenancy\Tests\TestCase;
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');
}
}