diff --git a/src/Expectation.php b/src/Expectation.php index ddca5bda..727fdc27 100644 --- a/src/Expectation.php +++ b/src/Expectation.php @@ -9,10 +9,10 @@ use Closure; use Pest\Arch\Contracts\ArchExpectation; use Pest\Arch\Expectations\ToBeUsedOn; use Pest\Arch\Expectations\ToBeUsedOnNothing; -use Pest\Arch\Expectations\ToDependOn; -use Pest\Arch\Expectations\ToDependOnNothing; +use Pest\Arch\Expectations\ToUse; +use Pest\Arch\Expectations\ToUseNothing; use Pest\Arch\Expectations\ToOnlyBeUsedOn; -use Pest\Arch\Expectations\ToOnlyDependOn; +use Pest\Arch\Expectations\ToOnlyUse; use Pest\Concerns\Extendable; use Pest\Concerns\Pipeable; use Pest\Concerns\Retrievable; @@ -360,31 +360,31 @@ final class Expectation } /** - * Asserts that the given expectation target depends on the given dependencies. + * Asserts that the given expectation target use the given dependencies. * * @param array|string $targets */ - public function toDependOn(array|string $targets): ArchExpectation + public function toUse(array|string $targets): ArchExpectation { - return ToDependOn::make($this, $targets); + return ToUse::make($this, $targets); } /** - * Asserts that the given expectation target "only" depends on the given dependencies. + * Asserts that the given expectation target "only" use on the given dependencies. * * @param array|string $targets */ - public function toOnlyDependOn(array|string $targets): ArchExpectation + public function toOnlyUse(array|string $targets): ArchExpectation { - return ToOnlyDependOn::make($this, $targets); + return ToOnlyUse::make($this, $targets); } /** - * Asserts that the given expectation target does not have any dependencies. + * Asserts that the given expectation target does not use any dependencies. */ - public function toDependOnNothing(): ArchExpectation + public function toUseNothing(): ArchExpectation { - return ToDependOnNothing::make($this); + return ToUseNothing::make($this); } public function toBeUsed(): never diff --git a/src/Expectations/OppositeExpectation.php b/src/Expectations/OppositeExpectation.php index 6fa22de7..2c9e53a2 100644 --- a/src/Expectations/OppositeExpectation.php +++ b/src/Expectations/OppositeExpectation.php @@ -7,7 +7,7 @@ namespace Pest\Expectations; use Pest\Arch\Contracts\ArchExpectation; use Pest\Arch\Expectations\ToBeUsedOn; use Pest\Arch\Expectations\ToBeUsedOnNothing; -use Pest\Arch\Expectations\ToDependOn; +use Pest\Arch\Expectations\ToUse; use Pest\Arch\GroupArchExpectation; use Pest\Arch\SingleArchExpectation; use Pest\Exceptions\InvalidExpectation; @@ -60,28 +60,28 @@ final class OppositeExpectation } /** - * Asserts that the given expectation target does not depend on any of the given dependencies. + * Asserts that the given expectation target does not use any of the given dependencies. * * @param array|string $targets */ - public function toDependOn(array|string $targets): ArchExpectation + public function toUse(array|string $targets): ArchExpectation { - return GroupArchExpectation::fromExpectations($this->original, array_map(fn (string $target): SingleArchExpectation => ToDependOn::make($this->original, $target)->opposite( - fn () => $this->throwExpectationFailedException('toDependOn', $target), + return GroupArchExpectation::fromExpectations($this->original, array_map(fn (string $target): SingleArchExpectation => ToUse::make($this->original, $target)->opposite( + fn () => $this->throwExpectationFailedException('toUse', $target), ), is_string($targets) ? [$targets] : $targets)); } /** * @param array|string $targets */ - public function toOnlyDependOn(array|string $targets): never + public function toOnlyUse(array|string $targets): never { - throw InvalidExpectation::fromMethods(['not', 'toOnlyDependOn']); + throw InvalidExpectation::fromMethods(['not', 'toOnlyUse']); } - public function toDependOnNothing(): never + public function toUseNothing(): never { - throw InvalidExpectation::fromMethods(['not', 'toDependOnNothing']); + throw InvalidExpectation::fromMethods(['not', 'toUseNothing']); } /**