From c126378ff2f0eb8345fc420e45e534a66034f69b Mon Sep 17 00:00:00 2001 From: Aleksei Lebedev <1329824+LastDragon-ru@users.noreply.github.com> Date: Sun, 10 Nov 2024 10:31:47 +0400 Subject: [PATCH] test(spa): "Invalid URI: A URI cannot contain a backslash." error fix. --- packages/spa/src/Http/Resources/Scalar/BoolResourceTest.php | 4 +++- packages/spa/src/Http/Resources/Scalar/FalseResourceTest.php | 4 +++- packages/spa/src/Http/Resources/Scalar/IntResourceTest.php | 4 +++- packages/spa/src/Http/Resources/Scalar/NullResourceTest.php | 4 +++- packages/spa/src/Http/Resources/Scalar/NumberResourceTest.php | 4 +++- packages/spa/src/Http/Resources/Scalar/StringResourceTest.php | 4 +++- packages/spa/src/Http/Resources/Scalar/TrueResourceTest.php | 4 +++- 7 files changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/spa/src/Http/Resources/Scalar/BoolResourceTest.php b/packages/spa/src/Http/Resources/Scalar/BoolResourceTest.php index b00b7c04..5506eb4e 100644 --- a/packages/spa/src/Http/Resources/Scalar/BoolResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/BoolResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new BoolResource(true); }); - $this->get(__METHOD__)->assertThat(new OkResponse(BoolResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(BoolResource::class)); } } diff --git a/packages/spa/src/Http/Resources/Scalar/FalseResourceTest.php b/packages/spa/src/Http/Resources/Scalar/FalseResourceTest.php index bdca1d6a..a9c70027 100644 --- a/packages/spa/src/Http/Resources/Scalar/FalseResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/FalseResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new FalseResource(); }); - $this->get(__METHOD__)->assertThat(new OkResponse(FalseResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(FalseResource::class)); } } diff --git a/packages/spa/src/Http/Resources/Scalar/IntResourceTest.php b/packages/spa/src/Http/Resources/Scalar/IntResourceTest.php index 81b44ec1..fb767f67 100644 --- a/packages/spa/src/Http/Resources/Scalar/IntResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/IntResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new IntResource(123); }); - $this->get(__METHOD__)->assertThat(new OkResponse(IntResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(IntResource::class)); } } diff --git a/packages/spa/src/Http/Resources/Scalar/NullResourceTest.php b/packages/spa/src/Http/Resources/Scalar/NullResourceTest.php index fe96d67f..7334f107 100644 --- a/packages/spa/src/Http/Resources/Scalar/NullResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/NullResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new NullResource(); }); - $this->get(__METHOD__)->assertThat(new OkResponse(NullResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(NullResource::class)); } } diff --git a/packages/spa/src/Http/Resources/Scalar/NumberResourceTest.php b/packages/spa/src/Http/Resources/Scalar/NumberResourceTest.php index 34273482..a1c20232 100644 --- a/packages/spa/src/Http/Resources/Scalar/NumberResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/NumberResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new NumberResource(123); }); - $this->get(__METHOD__)->assertThat(new OkResponse(NumberResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(NumberResource::class)); } } diff --git a/packages/spa/src/Http/Resources/Scalar/StringResourceTest.php b/packages/spa/src/Http/Resources/Scalar/StringResourceTest.php index 2cea5a6c..15cddb69 100644 --- a/packages/spa/src/Http/Resources/Scalar/StringResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/StringResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new StringResource('123'); }); - $this->get(__METHOD__)->assertThat(new OkResponse(StringResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(StringResource::class)); } } diff --git a/packages/spa/src/Http/Resources/Scalar/TrueResourceTest.php b/packages/spa/src/Http/Resources/Scalar/TrueResourceTest.php index e72f6e24..cb87a075 100644 --- a/packages/spa/src/Http/Resources/Scalar/TrueResourceTest.php +++ b/packages/spa/src/Http/Resources/Scalar/TrueResourceTest.php @@ -7,6 +7,8 @@ use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse; use PHPUnit\Framework\Attributes\CoversClass; +use function urlencode; + /** * @internal */ @@ -18,6 +20,6 @@ public function testToResponse(): void { return new TrueResource(); }); - $this->get(__METHOD__)->assertThat(new OkResponse(TrueResource::class)); + $this->get(urlencode(__METHOD__))->assertThat(new OkResponse(TrueResource::class)); } }