mirror of
https://github.com/pestphp/pest.git
synced 2026-03-11 10:17:23 +01:00
chore: increase deps
This commit is contained in:
@ -14,6 +14,7 @@ use Pest\Arch\Expectations\ToOnlyBeUsedIn;
|
|||||||
use Pest\Arch\Expectations\ToOnlyUse;
|
use Pest\Arch\Expectations\ToOnlyUse;
|
||||||
use Pest\Arch\Expectations\ToUse;
|
use Pest\Arch\Expectations\ToUse;
|
||||||
use Pest\Arch\Expectations\ToUseNothing;
|
use Pest\Arch\Expectations\ToUseNothing;
|
||||||
|
use Pest\Arch\PendingArchExpectation;
|
||||||
use Pest\Arch\Support\FileLineFinder;
|
use Pest\Arch\Support\FileLineFinder;
|
||||||
use Pest\Concerns\Extendable;
|
use Pest\Concerns\Extendable;
|
||||||
use Pest\Concerns\Pipeable;
|
use Pest\Concerns\Pipeable;
|
||||||
@ -39,6 +40,7 @@ use PHPUnit\Framework\ExpectationFailedException;
|
|||||||
* @property EachExpectation $each Creates an expectation on each element on the traversable value.
|
* @property EachExpectation $each Creates an expectation on each element on the traversable value.
|
||||||
*
|
*
|
||||||
* @mixin Mixins\Expectation<TValue>
|
* @mixin Mixins\Expectation<TValue>
|
||||||
|
* @mixin PendingArchExpectation
|
||||||
*/
|
*/
|
||||||
final class Expectation
|
final class Expectation
|
||||||
{
|
{
|
||||||
@ -290,9 +292,15 @@ final class Expectation
|
|||||||
* @param array<int, mixed> $parameters
|
* @param array<int, mixed> $parameters
|
||||||
* @return Expectation<TValue>|HigherOrderExpectation<Expectation<TValue>, TValue>
|
* @return Expectation<TValue>|HigherOrderExpectation<Expectation<TValue>, TValue>
|
||||||
*/
|
*/
|
||||||
public function __call(string $method, array $parameters): Expectation|HigherOrderExpectation
|
public function __call(string $method, array $parameters): Expectation|HigherOrderExpectation|PendingArchExpectation
|
||||||
{
|
{
|
||||||
if (! self::hasMethod($method)) {
|
if (! self::hasMethod($method)) {
|
||||||
|
if (! is_object($this->value) && method_exists(PendingArchExpectation::class, $method)) {
|
||||||
|
$pendingArchExpectation = new PendingArchExpectation($this, []);
|
||||||
|
|
||||||
|
return $pendingArchExpectation->$method(...$parameters); // @phpstan-ignore-line
|
||||||
|
}
|
||||||
|
|
||||||
/* @phpstan-ignore-next-line */
|
/* @phpstan-ignore-next-line */
|
||||||
return new HigherOrderExpectation($this, call_user_func_array($this->value->$method(...), $parameters));
|
return new HigherOrderExpectation($this, call_user_func_array($this->value->$method(...), $parameters));
|
||||||
}
|
}
|
||||||
@ -336,6 +344,11 @@ final class Expectation
|
|||||||
public function __get(string $name)
|
public function __get(string $name)
|
||||||
{
|
{
|
||||||
if (! self::hasMethod($name)) {
|
if (! self::hasMethod($name)) {
|
||||||
|
if (! is_object($this->value) && method_exists(PendingArchExpectation::class, $name)) {
|
||||||
|
/* @phpstan-ignore-next-line */
|
||||||
|
return $this->{$name}();
|
||||||
|
}
|
||||||
|
|
||||||
/* @phpstan-ignore-next-line */
|
/* @phpstan-ignore-next-line */
|
||||||
return new HigherOrderExpectation($this, $this->retrieve($name, $this->value));
|
return new HigherOrderExpectation($this, $this->retrieve($name, $this->value));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,6 +10,7 @@ use Pest\Arch\Expectations\ToBeUsedIn;
|
|||||||
use Pest\Arch\Expectations\ToBeUsedInNothing;
|
use Pest\Arch\Expectations\ToBeUsedInNothing;
|
||||||
use Pest\Arch\Expectations\ToUse;
|
use Pest\Arch\Expectations\ToUse;
|
||||||
use Pest\Arch\GroupArchExpectation;
|
use Pest\Arch\GroupArchExpectation;
|
||||||
|
use Pest\Arch\PendingArchExpectation;
|
||||||
use Pest\Arch\SingleArchExpectation;
|
use Pest\Arch\SingleArchExpectation;
|
||||||
use Pest\Arch\Support\FileLineFinder;
|
use Pest\Arch\Support\FileLineFinder;
|
||||||
use Pest\Exceptions\InvalidExpectation;
|
use Pest\Exceptions\InvalidExpectation;
|
||||||
@ -318,6 +319,10 @@ final class OppositeExpectation
|
|||||||
public function __call(string $name, array $arguments): Expectation
|
public function __call(string $name, array $arguments): Expectation
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
if (! is_object($this->original->value) && method_exists(PendingArchExpectation::class, $name)) {
|
||||||
|
throw InvalidExpectation::fromMethods(['not', $name]);
|
||||||
|
}
|
||||||
|
|
||||||
/* @phpstan-ignore-next-line */
|
/* @phpstan-ignore-next-line */
|
||||||
$this->original->{$name}(...$arguments);
|
$this->original->{$name}(...$arguments);
|
||||||
} catch (ExpectationFailedException|AssertionFailedError) {
|
} catch (ExpectationFailedException|AssertionFailedError) {
|
||||||
@ -335,8 +340,12 @@ final class OppositeExpectation
|
|||||||
public function __get(string $name): Expectation
|
public function __get(string $name): Expectation
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
if (! is_object($this->original->value) && method_exists(PendingArchExpectation::class, $name)) {
|
||||||
|
throw InvalidExpectation::fromMethods(['not', $name]);
|
||||||
|
}
|
||||||
|
|
||||||
$this->original->{$name}; // @phpstan-ignore-line
|
$this->original->{$name}; // @phpstan-ignore-line
|
||||||
} catch (ExpectationFailedException) { // @phpstan-ignore-line
|
} catch (ExpectationFailedException) {
|
||||||
return $this->original;
|
return $this->original;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -159,9 +159,11 @@ final class Coverage
|
|||||||
* ['11', '20..25', '50', '60..80'];
|
* ['11', '20..25', '50', '60..80'];
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
|
*
|
||||||
|
* @param File $file
|
||||||
* @return array<int, string>
|
* @return array<int, string>
|
||||||
*/
|
*/
|
||||||
public static function getMissingCoverage(File $file): array
|
public static function getMissingCoverage($file): array
|
||||||
{
|
{
|
||||||
$shouldBeNewLine = true;
|
$shouldBeNewLine = true;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user