Skip to content

Commit

Permalink
Test case for "testdox" option with dataProvider providing indexed array
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored and sebastianbergmann committed Oct 12, 2018
1 parent 5015bff commit c34b889
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions tests/_files/DataProviderTestDoxTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ public function testDoesSomethingElseWith(): void
$this->assertTrue(true);
}

/**
* @dataProvider providerWithIndexedArray
*/
public function testWithProviderWithIndexedArrayWith($value): void
{
$this->assertTrue(true);
}

/**
* @dataProvider placeHolderprovider
* @testdox ... $value ...
Expand All @@ -45,6 +53,14 @@ public function provider()
];
}

public function providerWithIndexedArray()
{
return [
['first'],
['second'],
];
}

public function placeHolderprovider(): array
{
return [
Expand Down
4 changes: 3 additions & 1 deletion tests/end-to-end/dataprovider-testdox.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ DataProviderTestDox
✔ Does something with data set "two"
✔ Does something else with data set "one"
✔ Does something else with data set "two"
✔ With provider with indexed array with data set #0
✔ With provider with indexed array with data set #1
✔ ... true ...
✔ ... 1 ...
✔ ... 1.0 ...
Expand All @@ -29,4 +31,4 @@ DataProviderTestDox

Time: %s, Memory: %s

OK (13 tests, 13 assertions)
OK (15 tests, 15 assertions)

0 comments on commit c34b889

Please sign in to comment.