Uses Collision ^7.0

This commit is contained in:
Nuno Maduro
2022-09-15 01:07:15 +01:00
parent eab944023c
commit 3ff95faaaa
47 changed files with 646 additions and 308 deletions

View File

@ -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,
]);
});