Skip to content

Commit 6c79a47

Browse files
Add test for #6391
1 parent 2783230 commit 6c79a47

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6391
3+
--XFAIL--
4+
https://github.com/sebastianbergmann/phpunit/issues/6391
5+
--FILE--
6+
<?php declare(strict_types=1);
7+
$_SERVER['argv'][] = '--no-configuration';
8+
$_SERVER['argv'][] = '--do-not-cache-result';
9+
$_SERVER['argv'][] = '--debug';
10+
$_SERVER['argv'][] = '--static-backup';
11+
$_SERVER['argv'][] = __DIR__ . '/6391/tests/Issue6391Test.php';
12+
13+
require_once __DIR__ . '/../../bootstrap.php';
14+
15+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
16+
--EXPECTF--
17+
PHPUnit Started (PHPUnit %s using %s)
18+
Test Runner Configured
19+
Event Facade Sealed
20+
Test Suite Loaded (1 test)
21+
Test Runner Started
22+
Test Suite Sorted
23+
Test Runner Execution Started (1 test)
24+
Test Suite Started (TestFixture\Issue6391\Issue6391Test, 1 test)
25+
Before First Test Method Called (TestFixture\Issue6391\Issue6391Test::setUpBeforeClass)
26+
Before First Test Method Finished:
27+
- TestFixture\Issue6391\Issue6391Test::setUpBeforeClass
28+
Test Preparation Started (TestFixture\Issue6391\Issue6391Test::testOne)
29+
Test Prepared (TestFixture\Issue6391\Issue6391Test::testOne)
30+
Test Passed (TestFixture\Issue6391\Issue6391Test::testOne)
31+
Test Finished (TestFixture\Issue6391\Issue6391Test::testOne)
32+
Test Suite Finished (TestFixture\Issue6391\Issue6391Test, 1 test)
33+
Test Runner Execution Finished
34+
Test Runner Finished
35+
PHPUnit Finished (Shell Exit Code: 0)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace TestFixture\Issue6391;
11+
12+
use Error;
13+
14+
class Issue6391
15+
{
16+
public static $instance;
17+
18+
public function __unserialize(array $data): void
19+
{
20+
throw new Error("Cannot unserialize '{$this}'");
21+
}
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace TestFixture\Issue6391;
11+
12+
use PHPUnit\Framework\TestCase;
13+
14+
require __DIR__ . '/../src/Issue6391.php';
15+
16+
final class Issue6391Test extends TestCase
17+
{
18+
public static function setUpBeforeClass(): void
19+
{
20+
Issue6391::$instance = new Issue6391;
21+
}
22+
23+
public function testOne(): void
24+
{
25+
$this->assertTrue(true);
26+
}
27+
}

0 commit comments

Comments
 (0)