Skip to content

Commit

Permalink
Merge branch '7.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Sep 7, 2018
2 parents bf1410d + 8b1fa60 commit 79988e1
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ChangeLog-6.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes of the PHPUnit 6.5 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [6.5.13] - 2018-MM-DD

* Fixed [#3254](https://github.com/sebastianbergmann/phpunit/issues/3254): TextUI test runner cannot run a `Test` instance that is not a `TestSuite`

## [6.5.12] - 2018-08-22

* Fixed [#3248](https://github.com/sebastianbergmann/phpunit/issues/3248) and [#3233](https://github.com/sebastianbergmann/phpunit/issues/3233): `phpunit.xsd` dictates element order where it should not
Expand Down Expand Up @@ -85,6 +89,7 @@ All notable changes of the PHPUnit 6.5 release series are documented in this fil
* Fixed [#2654](https://github.com/sebastianbergmann/phpunit/issues/2654): Problems with `assertJsonStringEqualsJsonString()`
* Fixed [#2810](https://github.com/sebastianbergmann/phpunit/pull/2810): Code Coverage for PHPT tests does not work

[6.5.13]: https://github.com/sebastianbergmann/phpunit/compare/6.5.12...6.5.13
[6.5.12]: https://github.com/sebastianbergmann/phpunit/compare/6.5.11...6.5.12
[6.5.11]: https://github.com/sebastianbergmann/phpunit/compare/6.5.10...6.5.11
[6.5.10]: https://github.com/sebastianbergmann/phpunit/compare/6.5.9...6.5.10
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog-7.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes of the PHPUnit 7.3 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [7.3.5] - 2018-MM-DD

### Fixed

* Fixed [#3254](https://github.com/sebastianbergmann/phpunit/issues/3254): TextUI test runner cannot run a `Test` instance that is not a `TestSuite`

## [7.3.4] - 2018-09-05

### Fixed
Expand Down Expand Up @@ -58,6 +64,7 @@ All notable changes of the PHPUnit 7.3 release series are documented in this fil
* Fixed [#3222](https://github.com/sebastianbergmann/phpunit/pull/3222): Priority of `@covers` and `@coversNothing` is wrong
* Fixed [#3225](https://github.com/sebastianbergmann/phpunit/issues/3225): `coverage-php` missing from `phpunit.xsd`

[7.3.5]: https://github.com/sebastianbergmann/phpunit/compare/7.3.4...7.3.5
[7.3.4]: https://github.com/sebastianbergmann/phpunit/compare/7.3.3...7.3.4
[7.3.3]: https://github.com/sebastianbergmann/phpunit/compare/7.3.2...7.3.3
[7.3.2]: https://github.com/sebastianbergmann/phpunit/compare/7.3.1...7.3.2
Expand Down
3 changes: 1 addition & 2 deletions src/TextUI/TestRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ public function doRun(Test $suite, array $arguments = [], bool $exit = true): Te

$this->handleConfiguration($arguments);

$this->processSuiteFilters($suite, $arguments);

if (isset($arguments['bootstrap'])) {
$GLOBALS['__PHPUNIT_BOOTSTRAP'] = $arguments['bootstrap'];
}
Expand Down Expand Up @@ -575,6 +573,7 @@ public function doRun(Test $suite, array $arguments = [], bool $exit = true): Te
$result->setTimeoutForLargeTests($arguments['timeoutForLargeTests']);

if ($suite instanceof TestSuite) {
$this->processSuiteFilters($suite, $arguments);
$suite->setRunTestInSeparateProcess($arguments['processIsolation']);
}

Expand Down
49 changes: 49 additions & 0 deletions tests/unit/TextUI/TestRunnerTest.php
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;
}
}

0 comments on commit 79988e1

Please sign in to comment.