Skip to content

Commit e484176

Browse files
committed
add test which uses #[RunTestsInSeparateProcesses]
1 parent 32e3acb commit e484176

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <sebastian@phpunit.de>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
11+
use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
12+
use PHPUnit\Framework\TestCase;
13+
14+
#[RunTestsInSeparateProcesses]
15+
final class RepeatInIsolationTest extends TestCase
16+
{
17+
public function test1(): void
18+
{
19+
$this->assertTrue(true);
20+
}
21+
22+
public function test2(): void
23+
{
24+
$this->assertTrue(true);
25+
}
26+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
--TEST--
2+
Repeat option
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = '--repeat';
8+
$_SERVER['argv'][] = '2';
9+
$_SERVER['argv'][] = __DIR__ . '/_files/RepeatInIsolationTest.php';
10+
11+
require __DIR__ . '/../../bootstrap.php';
12+
13+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
14+
--EXPECTF--
15+
PHPUnit %s by Sebastian Bergmann and contributors.
16+
17+
Runtime: %s
18+
19+
.... 4 / 4 (100%)
20+
21+
Time: %s, Memory: %s MB
22+
23+
OK (4 tests, 4 assertions)

0 commit comments

Comments
 (0)