Skip to content

Commit c34b889

Browse files
kubawerlossebastianbergmann
authored andcommitted
Test case for "testdox" option with dataProvider providing indexed array
1 parent 5015bff commit c34b889

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

tests/_files/DataProviderTestDoxTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ public function testDoesSomethingElseWith(): void
2828
$this->assertTrue(true);
2929
}
3030

31+
/**
32+
* @dataProvider providerWithIndexedArray
33+
*/
34+
public function testWithProviderWithIndexedArrayWith($value): void
35+
{
36+
$this->assertTrue(true);
37+
}
38+
3139
/**
3240
* @dataProvider placeHolderprovider
3341
* @testdox ... $value ...
@@ -45,6 +53,14 @@ public function provider()
4553
];
4654
}
4755

56+
public function providerWithIndexedArray()
57+
{
58+
return [
59+
['first'],
60+
['second'],
61+
];
62+
}
63+
4864
public function placeHolderprovider(): array
4965
{
5066
return [

tests/end-to-end/dataprovider-testdox.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ DataProviderTestDox
1717
✔ Does something with data set "two"
1818
✔ Does something else with data set "one"
1919
✔ Does something else with data set "two"
20+
✔ With provider with indexed array with data set #0
21+
✔ With provider with indexed array with data set #1
2022
✔ ... true ...
2123
✔ ... 1 ...
2224
✔ ... 1.0 ...
@@ -29,4 +31,4 @@ DataProviderTestDox
2931

3032
Time: %s, Memory: %s
3133

32-
OK (13 tests, 13 assertions)
34+
OK (15 tests, 15 assertions)

0 commit comments

Comments
 (0)