From 3bdd624fc9428fff65ec3373f3d9a9b2c9c4fa4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 3 May 2020 17:48:44 +0200 Subject: [PATCH] update tests --- src/Features/CrossDomainRedirect.php | 2 +- tests/RedirectTest.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Features/CrossDomainRedirect.php b/src/Features/CrossDomainRedirect.php index 8cdb19c0..8eecaeee 100644 --- a/src/Features/CrossDomainRedirect.php +++ b/src/Features/CrossDomainRedirect.php @@ -12,7 +12,7 @@ class CrossDomainRedirect implements Feature { public function bootstrap(TenantManager $tenantManager): void { - RedirectResponse::macro('tenant', function (string $domain) { + RedirectResponse::macro('domain', function (string $domain) { // replace first occurance of hostname fragment with $domain $url = $this->getTargetUrl(); $hostname = parse_url($url, PHP_URL_HOST); diff --git a/tests/RedirectTest.php b/tests/RedirectTest.php index c0bd90a8..ededb239 100644 --- a/tests/RedirectTest.php +++ b/tests/RedirectTest.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace Stancl\Tenancy\Tests; use Route; +use Stancl\Tenancy\Features\CrossDomainRedirect; use Stancl\Tenancy\Tenant; class RedirectTest extends TestCase @@ -16,7 +17,7 @@ class RedirectTest extends TestCase public function tenant_redirect_macro_replaces_only_the_hostname() { config([ - 'tenancy.features' => ['Stancl\Tenancy\Features\TenantRedirect'], + 'tenancy.features' => [CrossDomainRedirect::class], ]); Route::get('/foobar', function () { @@ -24,7 +25,7 @@ class RedirectTest extends TestCase })->name('home'); Route::get('/redirect', function () { - return redirect()->route('home')->tenant('abcd'); + return redirect()->route('home')->domain('abcd'); }); Tenant::create('foo.localhost');