File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ /*
4
+ * This file is part of PHPUnit.
5
+ *
6
+ * (c) Sebastian Bergmann <[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
+ namespace PHPUnit \TestFixture ;
12
+
13
+ use PHPUnit \Framework \Attributes \DataProvider ;
14
+ use PHPUnit \Framework \Attributes \RunInSeparateProcess ;
15
+ use PHPUnit \Framework \TestCase ;
16
+
17
+ final class TestProcessIsolationWithDataProvider extends TestCase
18
+ {
19
+ public static function greetDataProvider (): iterable
20
+ {
21
+ yield ['Hello world! ' ];
22
+ }
23
+
24
+ #[RunInSeparateProcess]
25
+ #[DataProvider('greetDataProvider ' )]
26
+ public function testInIsolationWithProvider (string $ expected ): void
27
+ {
28
+ $ this ->assertSame ($ expected , 'Hello world! ' );
29
+ }
30
+ }
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ phpunit ../_files/TestProcessIsolationWithDataProvider.php
3
+ --FILE--
4
+ <?php declare (strict_types=1 );
5
+ $ _SERVER ['argv ' ][] = '--do-not-cache-result ' ;
6
+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
7
+ $ _SERVER ['argv ' ][] = __DIR__ . '/../_files/TestProcessIsolationWithDataProvider.php ' ;
8
+
9
+ require_once __DIR__ . '/../../bootstrap.php ' ;
10
+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
11
+ --EXPECTF --
12
+ PHPUnit %s by Sebastian Bergmann and contributors.
13
+
14
+ Runtime: %s
15
+
16
+ . 1 / 1 (100 %)
17
+
18
+ Time: %s, Memory: %s
19
+
20
+ OK (1 test, 1 assertion)
You can’t perform that action at this time.
0 commit comments