mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 989e43d1a0 | |||
| 7cd42aafd8 | |||
| 48a1de273f | |||
| 970e16e949 | |||
| 432ff221c6 |
@ -264,7 +264,7 @@ final class Expectation
|
|||||||
$matched = false;
|
$matched = false;
|
||||||
|
|
||||||
foreach ($expressions as $key => $callback) {
|
foreach ($expressions as $key => $callback) {
|
||||||
if ($subject != $key) {
|
if ($subject != $key) { // @pest-arch-ignore-line
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -380,7 +380,7 @@ final class Expectation
|
|||||||
if (self::hasExtend($name)) {
|
if (self::hasExtend($name)) {
|
||||||
$extend = self::$extends[$name]->bindTo($this, Expectation::class);
|
$extend = self::$extends[$name]->bindTo($this, Expectation::class);
|
||||||
|
|
||||||
if ($extend != false) {
|
if ($extend != false) { // @pest-arch-ignore-line
|
||||||
return $extend;
|
return $extend;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -522,9 +522,9 @@ final class Expectation
|
|||||||
{
|
{
|
||||||
return Targeted::make(
|
return Targeted::make(
|
||||||
$this,
|
$this,
|
||||||
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' == '), // @pest-arch-ignore-line
|
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' == ') && ! str_contains((string) file_get_contents($object->path), ' != '),
|
||||||
'to use strict equality',
|
'to use strict equality',
|
||||||
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' == ')),
|
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' == ') || str_contains($line, ' != ')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -159,9 +159,9 @@ final readonly class OppositeExpectation
|
|||||||
{
|
{
|
||||||
return Targeted::make(
|
return Targeted::make(
|
||||||
$this->original,
|
$this->original,
|
||||||
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' === '),
|
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' === ') && ! str_contains((string) file_get_contents($object->path), ' !== '),
|
||||||
'to use strict equality',
|
'to use strict equality',
|
||||||
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' === ')),
|
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' === ') || str_contains($line, ' !== ')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,7 @@ final readonly class Converter
|
|||||||
{
|
{
|
||||||
if ($testSuite instanceof TestSuiteForTestMethodWithDataProvider) {
|
if ($testSuite instanceof TestSuiteForTestMethodWithDataProvider) {
|
||||||
$firstTest = $this->getFirstTest($testSuite);
|
$firstTest = $this->getFirstTest($testSuite);
|
||||||
if ($firstTest != null) {
|
if ($firstTest instanceof \PHPUnit\Event\Code\TestMethod) {
|
||||||
return $this->getTestMethodNameWithoutDatasetSuffix($firstTest);
|
return $this->getTestMethodNameWithoutDatasetSuffix($firstTest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Pest\PendingCalls;
|
namespace Pest\PendingCalls;
|
||||||
|
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Pest\Concerns\Testable;
|
||||||
use Pest\Exceptions\InvalidArgumentException;
|
use Pest\Exceptions\InvalidArgumentException;
|
||||||
use Pest\Exceptions\TestDescriptionMissing;
|
use Pest\Exceptions\TestDescriptionMissing;
|
||||||
use Pest\Factories\Attribute;
|
use Pest\Factories\Attribute;
|
||||||
@ -25,9 +26,9 @@ use PHPUnit\Framework\TestCase;
|
|||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* @mixin HigherOrderCallables|TestCase
|
* @mixin HigherOrderCallables|TestCase|Testable
|
||||||
*/
|
*/
|
||||||
final class TestCall
|
final class TestCall // @phpstan-ignore-line
|
||||||
{
|
{
|
||||||
use Describable;
|
use Describable;
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ namespace Pest;
|
|||||||
|
|
||||||
function version(): string
|
function version(): string
|
||||||
{
|
{
|
||||||
return '3.2.0';
|
return '3.2.2';
|
||||||
}
|
}
|
||||||
|
|
||||||
function testDirectory(string $file = ''): string
|
function testDirectory(string $file = ''): string
|
||||||
|
|||||||
@ -26,7 +26,7 @@ final class Closure
|
|||||||
|
|
||||||
$closure = BaseClosure::bind($closure, $newThis, $newScope);
|
$closure = BaseClosure::bind($closure, $newThis, $newScope);
|
||||||
|
|
||||||
if ($closure === null) {
|
if (! $closure instanceof \Closure) {
|
||||||
throw ShouldNotHappen::fromMessage('Could not bind closure.');
|
throw ShouldNotHappen::fromMessage('Could not bind closure.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Pest Testing Framework 3.2.0.
|
Pest Testing Framework 3.2.2.
|
||||||
|
|
||||||
USAGE: pest <file> [options]
|
USAGE: pest <file> [options]
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
|
|
||||||
Pest Testing Framework 3.2.0.
|
Pest Testing Framework 3.2.2.
|
||||||
|
|
||||||
|
|||||||
@ -14,5 +14,9 @@ class NotStrictEquality
|
|||||||
if ($a == $b) {
|
if ($a == $b) {
|
||||||
echo 'Equal';
|
echo 'Equal';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($a != $b) {
|
||||||
|
echo 'Equal';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,5 +14,9 @@ class StrictEquality
|
|||||||
if ($a === $b) {
|
if ($a === $b) {
|
||||||
echo 'Equal';
|
echo 'Equal';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($a !== $b) {
|
||||||
|
echo 'Equal';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user