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

[2.3.0] tenant_route() helper (#229)

* Add tenant_route helper

* Add tests

* Remove redundant setUp()

* Fix test namespaces

* Apply fixes from StyleCI
This commit is contained in:
Samuel Štancl 2019-11-29 00:12:07 +01:00 committed by GitHub
parent 4e477b472f
commit fd00be646e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 10 deletions

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Stancl\Tenancy\Tests\Feature;
namespace Stancl\Tenancy\Tests\Features;
use Stancl\Tenancy\Tests\TestCase;

View file

@ -1,37 +0,0 @@
<?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');
}
}

View file

@ -2,7 +2,7 @@
declare(strict_types=1);
namespace Stancl\Tenancy\Tests\Feature;
namespace Stancl\Tenancy\Tests\Features;
use Stancl\Tenancy\Features\Timestamps;
use Stancl\Tenancy\Tenant;