Skip to content

Commit

Permalink
test(spa): "Invalid URI: A URI cannot contain a backslash." error fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
LastDragon-ru committed Nov 10, 2024
1 parent 42b2adf commit c126378
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/spa/src/Http/Resources/Scalar/BoolResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}
4 changes: 3 additions & 1 deletion packages/spa/src/Http/Resources/Scalar/FalseResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}
4 changes: 3 additions & 1 deletion packages/spa/src/Http/Resources/Scalar/IntResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}
4 changes: 3 additions & 1 deletion packages/spa/src/Http/Resources/Scalar/NullResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}
4 changes: 3 additions & 1 deletion packages/spa/src/Http/Resources/Scalar/TrueResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use LastDragon_ru\LaraASP\Testing\Responses\Laravel\Json\OkResponse;
use PHPUnit\Framework\Attributes\CoversClass;

use function urlencode;

/**
* @internal
*/
Expand All @@ -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));
}
}

0 comments on commit c126378

Please sign in to comment.