|
| 1 | +<?php |
| 2 | + |
| 3 | +/* |
| 4 | + * This file is part of the Symfony package. |
| 5 | + * |
| 6 | + * (c) Fabien Potencier <[email protected]> |
| 7 | + * |
| 8 | + * For the full copyright and license information, please view the LICENSE |
| 9 | + * file that was distributed with this source code. |
| 10 | + */ |
| 11 | + |
| 12 | +namespace Symfony\Bridge\PhpUnit; |
| 13 | + |
| 14 | +use PHPUnit\Framework\Test; |
| 15 | +use PHPUnit\Framework\TestListener; |
| 16 | +use PHPUnit\Framework\TestListenerDefaultImplementation; |
| 17 | +use PHPUnit\Framework\TestSuite; |
| 18 | +use PHPUnit\Framework\Warning; |
| 19 | + |
| 20 | +/** |
| 21 | + * Collects and replays skipped tests. |
| 22 | + * |
| 23 | + * (Version of SymfonyTestsListener for PHPUnit 7+, and PHP 7.1+.) |
| 24 | + * |
| 25 | + * @author Nicolas Grekas <[email protected]> |
| 26 | + * |
| 27 | + * @final |
| 28 | + */ |
| 29 | +class SymfonyTestsListenerWithReturnTypes implements TestListener |
| 30 | +{ |
| 31 | + use TestListenerDefaultImplementation; |
| 32 | + |
| 33 | + private $trait; |
| 34 | + |
| 35 | + public function __construct(array $mockedNamespaces = array()) |
| 36 | + { |
| 37 | + $this->trait = new Legacy\SymfonyTestsListenerTrait($mockedNamespaces); |
| 38 | + } |
| 39 | + |
| 40 | + public function globalListenerDisabled() |
| 41 | + { |
| 42 | + $this->trait->globalListenerDisabled(); |
| 43 | + } |
| 44 | + |
| 45 | + public function startTestSuite(TestSuite $suite): void |
| 46 | + { |
| 47 | + $this->trait->startTestSuite($suite); |
| 48 | + } |
| 49 | + |
| 50 | + public function addSkippedTest(Test $test, \Throwable $t, float $time): void |
| 51 | + { |
| 52 | + $this->trait->addSkippedTest($test, $t, $time); |
| 53 | + } |
| 54 | + |
| 55 | + public function startTest(Test $test): void |
| 56 | + { |
| 57 | + $this->trait->startTest($test); |
| 58 | + } |
| 59 | + |
| 60 | + public function addWarning(Test $test, Warning $e, float $time): void |
| 61 | + { |
| 62 | + $this->trait->addWarning($test, $e, $time); |
| 63 | + } |
| 64 | + |
| 65 | + public function endTest(Test $test, float $time): void |
| 66 | + { |
| 67 | + $this->trait->endTest($test, $time); |
| 68 | + } |
| 69 | +} |
0 commit comments