mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
[1.8.0] Tenant redirect (#103)
This commit is contained in:
parent
6cee5d36ad
commit
b12b9c3a54
3 changed files with 40 additions and 1 deletions
23
tests/TenantRedirectMacroTest.php
Normal file
23
tests/TenantRedirectMacroTest.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Tests;
|
||||
|
||||
use Route;
|
||||
|
||||
class TenantRedirectMacroTest extends TestCase
|
||||
{
|
||||
/** @test */
|
||||
public function tenant_redirect_macro_replaces_only_the_hostname()
|
||||
{
|
||||
Route::get('/foobar', function () {
|
||||
return 'Foo';
|
||||
})->name('home');
|
||||
|
||||
Route::get('/redirect', function () {
|
||||
return redirect()->route('home')->tenant('abcd');
|
||||
});
|
||||
|
||||
$this->get('/redirect')
|
||||
->assertRedirect('http://abcd/foobar');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue