From b4b212a4260699f6e17b8affc3c75081854c8b3d Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Thu, 16 Mar 2023 19:48:49 +0000 Subject: [PATCH] feat: moves "UsedOn" to "UsedIn" --- src/Expectation.php | 18 +++++++++--------- src/Expectations/OppositeExpectation.php | 20 ++++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Expectation.php b/src/Expectation.php index 4d5e001c..07b0d5d5 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -7,9 +7,9 @@ namespace Pest; use BadMethodCallException; use Closure; use Pest\Arch\Contracts\ArchExpectation; -use Pest\Arch\Expectations\ToBeUsedOn; -use Pest\Arch\Expectations\ToBeUsedOnNothing; -use Pest\Arch\Expectations\ToOnlyBeUsedOn; +use Pest\Arch\Expectations\ToBeUsedIn; +use Pest\Arch\Expectations\ToBeUsedInNothing; +use Pest\Arch\Expectations\ToOnlyBeUsedIn; use Pest\Arch\Expectations\ToOnlyUse; use Pest\Arch\Expectations\ToUse; use Pest\Arch\Expectations\ToUseNothing; @@ -397,9 +397,9 @@ final class Expectation * * @param array|string $targets */ - public function toBeUsedOn(array|string $targets): ArchExpectation + public function toBeUsedIn(array|string $targets): ArchExpectation { - return ToBeUsedOn::make($this, $targets); + return ToBeUsedIn::make($this, $targets); } /** @@ -407,16 +407,16 @@ final class Expectation * * @param array|string $targets */ - public function toOnlyBeUsedOn(array|string $targets): ArchExpectation + public function toOnlyBeUsedIn(array|string $targets): ArchExpectation { - return ToOnlyBeUsedOn::make($this, $targets); + return ToOnlyBeUsedIn::make($this, $targets); } /** * Asserts that the given expectation dependency is not used. */ - public function toBeUsedOnNothing(): ArchExpectation + public function toBeUsedInNothing(): ArchExpectation { - return ToBeUsedOnNothing::make($this); + return ToBeUsedInNothing::make($this); } } diff --git a/src/Expectations/OppositeExpectation.php b/src/Expectations/OppositeExpectation.php index c0de2f0c..327676db 100644 --- a/src/Expectations/OppositeExpectation.php +++ b/src/Expectations/OppositeExpectation.php @@ -5,8 +5,8 @@ declare(strict_types=1); namespace Pest\Expectations; use Pest\Arch\Contracts\ArchExpectation; -use Pest\Arch\Expectations\ToBeUsedOn; -use Pest\Arch\Expectations\ToBeUsedOnNothing; +use Pest\Arch\Expectations\ToBeUsedIn; +use Pest\Arch\Expectations\ToBeUsedInNothing; use Pest\Arch\Expectations\ToUse; use Pest\Arch\GroupArchExpectation; use Pest\Arch\SingleArchExpectation; @@ -89,7 +89,7 @@ final class OppositeExpectation */ public function toBeUsed(): ArchExpectation { - return ToBeUsedOnNothing::make($this->original); + return ToBeUsedInNothing::make($this->original); } /** @@ -97,24 +97,24 @@ final class OppositeExpectation * * @param array|string $targets */ - public function toBeUsedOn(array|string $targets): ArchExpectation + public function toBeUsedIn(array|string $targets): ArchExpectation { - return GroupArchExpectation::fromExpectations($this->original, array_map(fn (string $target): GroupArchExpectation => ToBeUsedOn::make($this->original, $target)->opposite( - fn () => $this->throwExpectationFailedException('toBeUsedOn', $target), + return GroupArchExpectation::fromExpectations($this->original, array_map(fn (string $target): GroupArchExpectation => ToBeUsedIn::make($this->original, $target)->opposite( + fn () => $this->throwExpectationFailedException('toBeUsedIn', $target), ), is_string($targets) ? [$targets] : $targets)); } - public function toOnlyBeUsedOn(): never + public function toOnlyBeUsedIn(): never { - throw InvalidExpectation::fromMethods(['not', 'toOnlyBeUsedOn']); + throw InvalidExpectation::fromMethods(['not', 'toOnlyBeUsedIn']); } /** * Asserts that the given expectation dependency is not used. */ - public function toBeUsedOnNothing(): never + public function toBeUsedInNothing(): never { - throw InvalidExpectation::fromMethods(['not', 'toBeUsedOnNothing']); + throw InvalidExpectation::fromMethods(['not', 'toBeUsedInNothing']); } /**