From def75e5e223bd811e2359d836fb3f42b4b6ac4b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Fri, 2 Sep 2022 18:51:55 +0200 Subject: [PATCH] fix tests --- tests/PathIdentificationTest.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/PathIdentificationTest.php b/tests/PathIdentificationTest.php index 92f60926..8f9d84ab 100644 --- a/tests/PathIdentificationTest.php +++ b/tests/PathIdentificationTest.php @@ -135,10 +135,15 @@ test('tenant parameter is set for all routes as the default parameter once the t expect(tenancy()->initialized)->toBeFalse(); + // make a request that will initialize tenancy pest()->get(route('foo', ['tenant' => 'acme', 'a' => 1, 'b' => 2])); - expect(tenancy()->initialized)->toBeTrue() - ->and(tenant('id'))->toBe('acme') - ->and(route('baz', ['a' => 1, 'b' => 2]))->toBe('http://localhost/acme/baz/1/2'); + expect(tenancy()->initialized)->toBeTrue(); + expect(tenant('id'))->toBe('acme'); + + // assert that the route WITHOUT the tenant parameter matches the route WITH the tenant parameter + expect(route('baz', ['a' => 1, 'b' => 2]))->toBe(route('baz', ['tenant' => acme, 'a' => 1, 'b' => 2])); + + expect(route('baz', ['a' => 1, 'b' => 2]))->toBe('http://localhost/acme/baz/1/2'); // assert the full route string pest()->get(route('baz', ['a' => 1, 'b' => 2]))->assertOk(); // Assert route don't need tenant parameter });