Skip to content

Commit

Permalink
[Phpunit] Fix running skipped tests expecting only deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed Jan 28, 2020
1 parent b90664b commit 8db376e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
Expand Up @@ -196,7 +196,7 @@ public function addSkippedTest($test, \Exception $e, $time)

public function startTest($test)
{
if (-2 < $this->state && ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase)) {
if (-2 < $this->state && ($test instanceof \PHPUnit\Framework\TestCase || $test instanceof TestCase) && $test->getTestResultObject()) {
// This event is triggered before the test is re-run in isolation
if ($this->willBeIsolated($test)) {
$this->runsInSeparateProcess = tempnam(sys_get_temp_dir(), 'deprec');
Expand Down
@@ -0,0 +1,34 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Bridge\PhpUnit\Tests;

use PHPUnit\Framework\TestCase;

/**
* This test is meant to be skipped.
*
* @requires extension ext-dummy
*/
final class OnlyExpectingDeprecationSkippedTest extends TestCase
{
/**
* Do not remove this test in the next major versions.
*
* @group legacy
*
* @expectedDeprecation unreachable
*/
public function testExpectingOnlyDeprecations()
{
$this->markTestIncomplete('should never be ran.');
}
}

0 comments on commit 8db376e

Please sign in to comment.