-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit test to reproduce issue #3254
- Loading branch information
1 parent
5edce73
commit 8cd20d7
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/* | ||
* This file is part of PHPUnit. | ||
* | ||
* (c) Sebastian Bergmann <sebastian@phpunit.de> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
namespace PHPUnit\TextUI; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class TestRunnerTest extends TestCase | ||
{ | ||
public function testTestIsRunnable() | ||
{ | ||
$runner = new TestRunner(); | ||
$runner->setPrinter($this->getResultPrinterMock()); | ||
$runner->doRun(new \Success(), ['filter' => 'foo'], false); | ||
} | ||
|
||
public function testSuiteIsRunnable() | ||
{ | ||
$runner = new TestRunner(); | ||
$runner->setPrinter($this->getResultPrinterMock()); | ||
$runner->doRun($this->getSuiteMock(), ['filter' => 'foo'], false); | ||
} | ||
|
||
/** | ||
* @return \PHPUnit\TextUI\ResultPrinter | ||
*/ | ||
private function getResultPrinterMock() | ||
{ | ||
return $this->createMock(\PHPUnit\TextUI\ResultPrinter::class); | ||
} | ||
|
||
/** | ||
* @return \PHPUnit\Framework\TestSuite | ||
*/ | ||
private function getSuiteMock() | ||
{ | ||
$suite = $this->createMock(\PHPUnit\Framework\TestSuite::class); | ||
$suite->expects($this->once())->method('injectFilter'); | ||
$suite->expects($this->once())->method('run'); | ||
|
||
return $suite; | ||
} | ||
} |