Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions src/Utils/Testing/SharpAssertions.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ trait SharpAssertions

private BreadcrumbBuilder $breadcrumbBuilder;

public function setUpSharpAssertions(): void
{
$this->setGlobalFilterUrlDefault();
}

public function sharpList(string $entityClassNameOrKey): PendingEntityList
{
$this->setGlobalFilterUrlDefault();
Expand Down Expand Up @@ -84,6 +79,8 @@ public function deleteFromSharpShow(string $entityClassNameOrKey, mixed $instanc
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->delete(
route(
Expand All @@ -100,6 +97,8 @@ public function deleteFromSharpList(string $entityClassNameOrKey, mixed $instanc
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->withHeader(
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER,
Expand All @@ -119,6 +118,8 @@ public function getSharpForm(string $entityClassNameOrKey, mixed $instanceId = n
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->get(
$instanceId
Expand All @@ -144,6 +145,8 @@ public function getSharpSingleForm(string $entityClassNameOrKey)
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->get(
route(
Expand All @@ -160,6 +163,8 @@ public function updateSharpForm(string $entityClassNameOrKey, $instanceId, array
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->post(
route(
Expand All @@ -177,6 +182,8 @@ public function updateSharpSingleForm(string $entityClassNameOrKey, array $data)
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->post(
route(
Expand All @@ -193,6 +200,8 @@ public function getSharpShow(string $entityClassNameOrKey, $instanceId)
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->get(
route(
Expand All @@ -210,6 +219,8 @@ public function storeSharpForm(string $entityClassNameOrKey, array $data)
{
$entityKey = $this->resolveEntityKey($entityClassNameOrKey);

$this->setGlobalFilterUrlDefault();

return $this
->post(
route(
Expand All @@ -236,6 +247,8 @@ public function callSharpInstanceCommandFromList(
? class_basename($commandKeyOrClassName)
: $commandKeyOrClassName;

$this->setGlobalFilterUrlDefault();

return $this
->withHeader(
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER,
Expand Down Expand Up @@ -265,6 +278,8 @@ public function callSharpInstanceCommandFromShow(
? class_basename($commandKeyOrClassName)
: $commandKeyOrClassName;

$this->setGlobalFilterUrlDefault();

return $this
->withHeader(
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER,
Expand Down Expand Up @@ -293,6 +308,8 @@ public function callSharpEntityCommandFromList(
? class_basename($commandKeyOrClassName)
: $commandKeyOrClassName;

$this->setGlobalFilterUrlDefault();

return $this
->withHeader(
SharpBreadcrumb::CURRENT_PAGE_URL_HEADER,
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Utils/Testing/SharpLegacyAssertionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@

$this->assertEquals(
route('code16.sharp.form.edit', [
'globalFilter' => 'root',
'globalFilter' => 'two',
'parentUri' => 's-list/leaves',
'entityKey' => 'leaves',
'instanceId' => 6,
Expand Down
Loading