mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Merge pull request #1146 from JHWelch/interpolated-dataset-names
Interpolated dataset names
This commit is contained in:
@ -194,7 +194,13 @@ trait Testable
|
||||
|
||||
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
|
||||
|
||||
$description = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
|
||||
$description = $method->description;
|
||||
if ($this->dataName()) {
|
||||
$description = str_contains((string) $description, ':dataset')
|
||||
? str_replace(':dataset', str_replace('dataset ', '', $this->dataName()), (string) $description)
|
||||
: $description.' with '.$this->dataName();
|
||||
}
|
||||
|
||||
$description = htmlspecialchars(html_entity_decode((string) $description), ENT_NOQUOTES);
|
||||
|
||||
if ($method->repetitions > 1) {
|
||||
|
||||
@ -63,6 +63,8 @@
|
||||
✓ lazy datasets with (1)
|
||||
✓ lazy datasets with (2)
|
||||
✓ lazy datasets did the job right
|
||||
✓ interpolated (1) lazy datasets
|
||||
✓ interpolated (2) lazy datasets
|
||||
✓ eager datasets with (1)
|
||||
✓ eager datasets with (2)
|
||||
✓ eager datasets did the job right
|
||||
@ -77,6 +79,8 @@
|
||||
✓ eager registered wrapped datasets did the job right
|
||||
✓ named datasets with dataset "one"
|
||||
✓ named datasets with dataset "two"
|
||||
✓ interpolated "one" named datasets
|
||||
✓ interpolated "two" named datasets
|
||||
✓ named datasets did the job right
|
||||
✓ lazy named datasets with (Bar)
|
||||
✓ it creates unique test case names with ('Name 1', Pest\Plugin Object (), true) #1
|
||||
@ -1440,4 +1444,4 @@
|
||||
WARN Tests\Visual\Version
|
||||
- visual snapshot of help command output
|
||||
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 21 skipped, 1030 passed (2515 assertions)
|
||||
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 21 skipped, 1034 passed (2519 assertions)
|
||||
@ -61,6 +61,10 @@ test('lazy datasets did the job right', function () use ($state) {
|
||||
expect($state->text)->toBe('12');
|
||||
});
|
||||
|
||||
test('interpolated :dataset lazy datasets', function ($text) {
|
||||
expect(true)->toBeTrue();
|
||||
})->with($datasets);
|
||||
|
||||
$state->text = '';
|
||||
|
||||
test('eager datasets', function ($text) use ($state, $datasets) {
|
||||
@ -109,6 +113,13 @@ test('named datasets', function ($text) use ($state, $datasets) {
|
||||
'two' => [2],
|
||||
]);
|
||||
|
||||
test('interpolated :dataset named datasets', function ($text) {
|
||||
expect(true)->toBeTrue();
|
||||
})->with([
|
||||
'one' => [1],
|
||||
'two' => [2],
|
||||
]);
|
||||
|
||||
test('named datasets did the job right', function () use ($state) {
|
||||
expect($state->text)->toBe('121212121212');
|
||||
});
|
||||
|
||||
@ -16,7 +16,7 @@ $run = function () {
|
||||
|
||||
test('parallel', function () use ($run) {
|
||||
expect($run('--exclude-group=integration'))
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 1016 passed (2483 assertions)')
|
||||
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 16 skipped, 1020 passed (2487 assertions)')
|
||||
->toContain('Parallel: 3 processes');
|
||||
})->skipOnWindows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user