Add a named dataset test to output to snapshot

This commit is contained in:
Stephen Shead
2020-09-30 15:39:17 +10:00
parent edcd2cb50e
commit aa352317cb
2 changed files with 19 additions and 5 deletions

View File

@ -6,7 +6,7 @@
✓ not property calls
PASS Tests\Expect\toBe
✓ expect true → toBeTrue → and false → toBeFalse
✓ expect true → toBeTrue → and false → toBeFalse
✓ strict comparisons
✓ failures
✓ not failures
@ -255,6 +255,9 @@
✓ eager wrapped registered datasets with (1)
✓ eager wrapped registered datasets with (2)
✓ eager registered wrapped datasets did the job right
✓ named datasets with data set "one" (1)
✓ named datasets with data set "two" (2)
✓ named datasets did the job right
✓ lazy named datasets with (Bar Object (...))
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #1
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #2
@ -292,8 +295,8 @@
✓ it has bar
PASS Tests\Features\PendingHigherOrderTests
✓ get 'foo' → get 'bar' → expect true → toBeTrue
✓ get 'foo' → expect true → toBeTrue
✓ get 'foo' → get 'bar' → expect true → toBeTrue
✓ get 'foo' → expect true → toBeTrue
WARN Tests\Features\Skip
✓ it do not skips
@ -388,5 +391,4 @@
✓ depends with defined arguments
✓ depends run test only once
Tests: 7 skipped, 228 passed
Tests: 7 skipped, 231 passed

View File

@ -95,6 +95,18 @@ test('eager registered wrapped datasets did the job right', function () use ($st
expect($state->text)->toBe('1212121212');
});
test('named datasets', function ($text) use ($state, $datasets) {
$state->text .= $text;
expect($datasets)->toContain([$text]);
})->with([
'one' => [1],
'two' => [2],
]);
test('named datasets did the job right', function () use ($state) {
expect($state->text)->toBe('121212121212');
});
class Bar
{
public $name = 1;