File tree 4 files changed +30
-0
lines changed
4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ protected function relativePath(string $path)
94
94
protected function getReflectionFromTest (string $ name )
95
95
{
96
96
list ($ klass , $ method ) = explode (':: ' , $ name );
97
+
98
+ // Handle data providers
99
+ $ parts = explode (" " , $ method , 2 );
100
+ if (count ($ parts ) > 1 ) {
101
+ $ method = $ parts [0 ];
102
+ }
103
+
97
104
$ c = new \ReflectionClass ($ klass );
98
105
$ m = $ c ->getMethod ($ method );
99
106
Original file line number Diff line number Diff line change @@ -93,6 +93,13 @@ protected function relativePath(string $path)
93
93
protected function getReflectionFromTest (string $ name )
94
94
{
95
95
list ($ klass , $ method ) = explode (':: ' , $ name );
96
+
97
+ // Handle data providers
98
+ $ parts = explode (" " , $ method , 2 );
99
+ if (count ($ parts ) > 1 ) {
100
+ $ method = $ parts [0 ];
101
+ }
102
+
96
103
$ c = new \ReflectionClass ($ klass );
97
104
$ m = $ c ->getMethod ($ method );
98
105
Original file line number Diff line number Diff line change @@ -45,5 +45,20 @@ public function testIncomplete()
45
45
{
46
46
$ this ->markTestIncomplete ('Incomplete ' );
47
47
}
48
+
49
+ /**
50
+ * @dataProvider demoProvider
51
+ */
52
+ public function testProvider ($ v )
53
+ {
54
+ $ this ->assertTrue ($ v );
55
+ }
56
+
57
+ public function demoProvider ()
58
+ {
59
+ return [
60
+ [false ]
61
+ ];
62
+ }
48
63
}
49
64
Original file line number Diff line number Diff line change @@ -19,5 +19,6 @@ PHPUnit\TextUI\Command::main();
19
19
::error file=test/_files/PrinterStatesTest.php,line=22::Error: Call to undefined method PrinterStatesTest::isMissing()
20
20
::warning file=test/_files/PrinterStatesTest.php,line=32::This is a test warning
21
21
::error file=test/_files/PrinterStatesTest.php,line=12::Failed asserting that false is true.
22
+ ::error file=test/_files/PrinterStatesTest.php,line=54::Failed asserting that false is true.
22
23
::warning file=test/_files/PrinterStatesTest.php,line=37::This is a risky test
23
24
::warning file=test/_files/PrinterStatesTest.php,line=40::This test did not perform any assertions%0A%0Atest/_files/PrinterStatesTest.php:40
You can’t perform that action at this time.
0 commit comments