Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Printer7.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ protected function relativePath(string $path)
protected function getReflectionFromTest(string $name)
{
list($klass, $method) = explode('::', $name);

// Handle data providers
$parts = explode(" ", $method, 2);
if (count($parts) > 1) {
$method = $parts[0];
}

$c = new \ReflectionClass($klass);
$m = $c->getMethod($method);

Expand Down
7 changes: 7 additions & 0 deletions src/Trait8.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ protected function relativePath(string $path)
protected function getReflectionFromTest(string $name)
{
list($klass, $method) = explode('::', $name);

// Handle data providers
$parts = explode(" ", $method, 2);
if (count($parts) > 1) {
$method = $parts[0];
}

$c = new \ReflectionClass($klass);
$m = $c->getMethod($method);

Expand Down
15 changes: 15 additions & 0 deletions test/_files/PrinterStatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,20 @@ public function testIncomplete()
{
$this->markTestIncomplete('Incomplete');
}

/**
* @dataProvider demoProvider
*/
public function testProvider($v)
{
$this->assertTrue($v);
}

public function demoProvider()
{
return [
[false]
];
}
}

1 change: 1 addition & 0 deletions test/states-test.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ PHPUnit\TextUI\Command::main();
::error file=test/_files/PrinterStatesTest.php,line=22::Error: Call to undefined method PrinterStatesTest::isMissing()
::warning file=test/_files/PrinterStatesTest.php,line=32::This is a test warning
::error file=test/_files/PrinterStatesTest.php,line=12::Failed asserting that false is true.
::error file=test/_files/PrinterStatesTest.php,line=54::Failed asserting that false is true.
::warning file=test/_files/PrinterStatesTest.php,line=37::This is a risky test
::warning file=test/_files/PrinterStatesTest.php,line=40::This test did not perform any assertions%0A%0Atest/_files/PrinterStatesTest.php:40