mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 47f2ae32c1 | |||
| 306b7eb2a6 | |||
| 02f72aabb2 | |||
| b00bc4d5ea | |||
| 8abc0d1920 | |||
| ea967b439f |
@ -18,7 +18,7 @@
|
|||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1.0",
|
"php": "^8.1.0",
|
||||||
"brianium/paratest": "^7.2.4",
|
"brianium/paratest": "^7.2.5",
|
||||||
"nunomaduro/collision": "^7.8.1",
|
"nunomaduro/collision": "^7.8.1",
|
||||||
"nunomaduro/termwind": "^1.15.1",
|
"nunomaduro/termwind": "^1.15.1",
|
||||||
"pestphp/pest-plugin": "^2.0.1",
|
"pestphp/pest-plugin": "^2.0.1",
|
||||||
|
|||||||
@ -127,6 +127,40 @@ final class Expectation
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dump the expectation value when the result of the condition is truthy.
|
||||||
|
*
|
||||||
|
* @param (\Closure(TValue): bool)|bool $condition
|
||||||
|
* @return self<TValue>
|
||||||
|
*/
|
||||||
|
public function ddWhen(Closure|bool $condition, mixed ...$arguments): Expectation
|
||||||
|
{
|
||||||
|
$condition = $condition instanceof Closure ? $condition($this->value) : $condition;
|
||||||
|
|
||||||
|
if (! $condition) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->dd(...$arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dump the expectation value when the result of the condition is falsy.
|
||||||
|
*
|
||||||
|
* @param (\Closure(TValue): bool)|bool $condition
|
||||||
|
* @return self<TValue>
|
||||||
|
*/
|
||||||
|
public function ddUnless(Closure|bool $condition, mixed ...$arguments): Expectation
|
||||||
|
{
|
||||||
|
$condition = $condition instanceof Closure ? $condition($this->value) : $condition;
|
||||||
|
|
||||||
|
if ($condition) {
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->dd(...$arguments);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send the expectation value to Ray along with all given arguments.
|
* Send the expectation value to Ray along with all given arguments.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace Pest;
|
|||||||
|
|
||||||
function version(): string
|
function version(): string
|
||||||
{
|
{
|
||||||
return '2.12.2';
|
return '2.13.0';
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDirectory(string $file = ''): string
|
function testDirectory(string $file = ''): string
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Pest Testing Framework 2.12.2.
|
Pest Testing Framework 2.13.0.
|
||||||
|
|
||||||
USAGE: pest <file> [options]
|
USAGE: pest <file> [options]
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
Pest Testing Framework 2.12.2.
|
Pest Testing Framework 2.13.0.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user