-
-
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.
- Loading branch information
1 parent
ef4c1be
commit a7d935d
Showing
6 changed files
with
98 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
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
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,20 @@ | ||
--TEST-- | ||
GH-3379: Dependent test of skipped test has status -1 | ||
--FILE-- | ||
<?php | ||
$_SERVER['argv'][1] = '--configuration'; | ||
$_SERVER['argv'][2] = __DIR__ . '/3379/'; | ||
|
||
require __DIR__ . '/../../../bootstrap.php'; | ||
PHPUnit\TextUI\Command::main(); | ||
--EXPECTF-- | ||
PHPUnit %s by Sebastian Bergmann and contributors. | ||
|
||
Skipped test testOne, status: 1 | ||
SSkipped test testTwo, status: 1 | ||
S 2 / 2 (100%) | ||
|
||
Time: %s, Memory: %s | ||
|
||
OK, but incomplete, skipped, or risky tests! | ||
Tests: 2, Assertions: 0, Skipped: 2. |
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,28 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* 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 Test; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
class Issue3379Test extends TestCase | ||
{ | ||
public function testOne(): void | ||
{ | ||
$this->markTestSkipped(); | ||
} | ||
|
||
/** | ||
* @depends testOne | ||
*/ | ||
public function testTwo(): void | ||
{ | ||
$this->assertTrue(true); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/end-to-end/regression/GitHub/3379/Issue3379TestListener.php
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,26 @@ | ||
<?php declare(strict_types=1); | ||
/* | ||
* 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. | ||
*/ | ||
|
||
use PHPUnit\Framework\Test; | ||
use PHPUnit\Framework\TestCase; | ||
use PHPUnit\Framework\TestListener; | ||
use PHPUnit\Framework\TestListenerDefaultImplementation; | ||
|
||
class Issue3379TestListener implements TestListener | ||
{ | ||
use TestListenerDefaultImplementation; | ||
|
||
public function addSkippedTest(Test $test, \Throwable $t, float $time): void | ||
{ | ||
if ($test instanceof TestCase) { | ||
print 'Skipped test ' . $test->getName() . ', status: ' . $test->getStatus() . \PHP_EOL; | ||
} | ||
} | ||
} |
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,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.4/phpunit.xsd"> | ||
<testsuites> | ||
<testsuite name="default"> | ||
<directory suffix="Test.php">.</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<listeners> | ||
<listener class="Issue3379TestListener" file="./Issue3379TestListener.php"/> | ||
</listeners> | ||
</phpunit> |