Skip to content

Commit

Permalink
fix params order for assertMethodNotWiredToAction and assertMethodWir…
Browse files Browse the repository at this point in the history
…edToAction (#42)
  • Loading branch information
lfnincao authored Nov 4, 2024
1 parent 04e2b3f commit e73a960
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .stubs.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public function assertMethodWired(string $method): self {}

public function assertMethodNotWired(string $method): self {}

public function assertMethodWiredToAction(string $methodName, string $action): self {}
public function assertMethodWiredToAction(string $action, string $methodName): self {}

public function assertMethodNotWiredToAction(string $methodName, string $action): self {}
public function assertMethodNotWiredToAction(string $action, string $methodName): self {}

public function assertMethodWiredToForm(string $method): self {}

Expand All @@ -44,7 +44,7 @@ public function assertSeeBefore($valueBefore, $valueAfter): self {}
public function assertDoNotSeeBefore($valueBefore, $valueAfter): self {}

public function assertFileDownloadedContains($content): self {}

public function assertFileDownloadedNotContains($content): self {}
}
}
8 changes: 4 additions & 4 deletions src/CustomLivewireAssertionsMixin.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public function assertMethodNotWired(): Closure
*/
public function assertMethodWiredToAction(): Closure
{
return function (string $methodName, string $action) {
return function (string $action, string $methodName) {
PHPUnit::assertMatchesRegularExpression(
'/wire:' . $methodName . '?=(?<q>"|\')'.preg_quote($action).'(\s*\(.+\)\s*)?\s*(\k\'q\')/',
'/wire:' . $action . '?=(?<q>"|\')'.preg_quote($methodName).'(\s*\(.+\)\s*)?\s*(\k\'q\')/',
$this->html()
);

Expand All @@ -138,9 +138,9 @@ public function assertMethodWiredToAction(): Closure
*/
public function assertMethodNotWiredToAction(): Closure
{
return function (string $methodName, string $action) {
return function (string $action, string $methodName) {
PHPUnit::assertDoesNotMatchRegularExpression(
'/wire:' . $methodName . '?=(?<q>"|\')'.preg_quote($action).'(\s*\(.+\)\s*)?\s*(\k\'q\')/',
'/wire:' . $action . '?=(?<q>"|\')'.preg_quote($methodName).'(\s*\(.+\)\s*)?\s*(\k\'q\')/',
$this->html()
);

Expand Down

0 comments on commit e73a960

Please sign in to comment.