mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
wip
This commit is contained in:
@ -102,6 +102,11 @@
|
|||||||
✓ more than two datasets with (2) / (4) / (5)
|
✓ more than two datasets with (2) / (4) / (5)
|
||||||
✓ more than two datasets with (2) / (4) / (6)
|
✓ more than two datasets with (2) / (4) / (6)
|
||||||
✓ more than two datasets did the job right
|
✓ more than two datasets did the job right
|
||||||
|
✓ eager registered wrapped datasets with Generator functions with (1)
|
||||||
|
✓ eager registered wrapped datasets with Generator functions with (2)
|
||||||
|
✓ eager registered wrapped datasets with Generator functions with (3)
|
||||||
|
✓ eager registered wrapped datasets with Generator functions with (4)
|
||||||
|
✓ eager registered wrapped datasets with Generator functions did the job right
|
||||||
✓ it can resolve a dataset after the test case is available with (Closure Object (...)) #1
|
✓ it can resolve a dataset after the test case is available with (Closure Object (...)) #1
|
||||||
✓ it can resolve a dataset after the test case is available with (Closure Object (...)) #2
|
✓ it can resolve a dataset after the test case is available with (Closure Object (...)) #2
|
||||||
✓ it can resolve a dataset after the test case is available with shared yield sets with (Closure Object (...)) #1
|
✓ it can resolve a dataset after the test case is available with shared yield sets with (Closure Object (...)) #1
|
||||||
@ -818,4 +823,4 @@
|
|||||||
PASS Tests\Visual\Version
|
PASS Tests\Visual\Version
|
||||||
✓ visual snapshot of help command output
|
✓ visual snapshot of help command output
|
||||||
|
|
||||||
Tests: 4 incomplete, 1 todo, 18 skipped, 562 passed (1460 assertions)
|
Tests: 4 incomplete, 1 todo, 18 skipped, 566 passed (1465 assertions)
|
||||||
@ -13,3 +13,20 @@ dataset('numbers.closure.wrapped', function () {
|
|||||||
dataset('numbers.array', [[1], [2]]);
|
dataset('numbers.array', [[1], [2]]);
|
||||||
|
|
||||||
dataset('numbers.array.wrapped', [1, 2]);
|
dataset('numbers.array.wrapped', [1, 2]);
|
||||||
|
|
||||||
|
dataset('numbers.generators.wrapped', function () {
|
||||||
|
yield from firstSetOfNumbers();
|
||||||
|
yield from secondSetOfNumbers();
|
||||||
|
});
|
||||||
|
|
||||||
|
function firstSetOfNumbers(): Generator
|
||||||
|
{
|
||||||
|
yield 1;
|
||||||
|
yield 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
function secondSetOfNumbers(): Generator
|
||||||
|
{
|
||||||
|
yield 3;
|
||||||
|
yield 4;
|
||||||
|
}
|
||||||
|
|||||||
@ -230,6 +230,25 @@ test('more than two datasets did the job right', function () use ($state) {
|
|||||||
expect($state->text)->toBe('121212121212131423241314232411122122111221221112212213142324135136145146235236245246');
|
expect($state->text)->toBe('121212121212131423241314232411122122111221221112212213142324135136145146235236245246');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$wrapped_generator_state = new stdClass();
|
||||||
|
$wrapped_generator_state->text = '';
|
||||||
|
$wrapped_generator_function_datasets = [1, 2, 3, 4];
|
||||||
|
|
||||||
|
test(
|
||||||
|
'eager registered wrapped datasets with Generator functions',
|
||||||
|
function (int $text) use (
|
||||||
|
$wrapped_generator_state,
|
||||||
|
$wrapped_generator_function_datasets
|
||||||
|
) {
|
||||||
|
$wrapped_generator_state->text .= $text;
|
||||||
|
expect(in_array($text, $wrapped_generator_function_datasets))->toBe(true);
|
||||||
|
}
|
||||||
|
)->with('numbers.generators.wrapped');
|
||||||
|
|
||||||
|
test('eager registered wrapped datasets with Generator functions did the job right', function () use ($wrapped_generator_state) {
|
||||||
|
expect($wrapped_generator_state->text)->toBe('1234');
|
||||||
|
});
|
||||||
|
|
||||||
it('can resolve a dataset after the test case is available', function ($result) {
|
it('can resolve a dataset after the test case is available', function ($result) {
|
||||||
expect($result)->toBe('bar');
|
expect($result)->toBe('bar');
|
||||||
})->with([
|
})->with([
|
||||||
|
|||||||
Reference in New Issue
Block a user