mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
Uses Collision ^7.0
This commit is contained in:
@ -36,7 +36,8 @@ class Symbol
|
||||
|
||||
class State
|
||||
{
|
||||
public array $runCount = [];
|
||||
public array $runCount = [];
|
||||
|
||||
public array $appliedCount = [];
|
||||
|
||||
public function __construct()
|
||||
@ -132,16 +133,16 @@ test('pipe is applied and can stop pipeline', function () use ($state) {
|
||||
expect($char)->toBe(new Char('A'))
|
||||
->and($state)
|
||||
->runCount->toMatchArray([
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
])
|
||||
->appliedCount->toMatchArray([
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
]);
|
||||
});
|
||||
|
||||
@ -151,16 +152,16 @@ test('pipe is run and can let the pipeline keep going', function () use ($state)
|
||||
expect(3)->toBe(3)
|
||||
->and($state)
|
||||
->runCount->toMatchArray([
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 1,
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 1,
|
||||
])
|
||||
->appliedCount->toMatchArray([
|
||||
'char' => 0,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 0,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
]);
|
||||
});
|
||||
|
||||
@ -172,16 +173,16 @@ test('pipe works with negated expectation', function () use ($state) {
|
||||
expect($char)->not->toBe(new Char('B'))
|
||||
->and($state)
|
||||
->runCount->toMatchArray([
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
])
|
||||
->appliedCount->toMatchArray([
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 1,
|
||||
'number' => 0,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
]);
|
||||
});
|
||||
|
||||
@ -204,16 +205,16 @@ test('interceptor stops the pipeline', function () use ($state) {
|
||||
expect($number)->toBe(new Number(1))
|
||||
->and($state)
|
||||
->runCount->toMatchArray([
|
||||
'char' => 1,
|
||||
'number' => 1,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 1,
|
||||
'number' => 1,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
])
|
||||
->appliedCount->toMatchArray([
|
||||
'char' => 0,
|
||||
'number' => 1,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
'char' => 0,
|
||||
'number' => 1,
|
||||
'wildcard' => 0,
|
||||
'symbol' => 0,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user