File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
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
+ namespace PHPUnit \TestFixture ;
11
+
12
+ use PHPUnit \Framework \TestCase ;
13
+
14
+ final class CwdRestoreTest extends TestCase
15
+ {
16
+ public function testChangesCwd (): void
17
+ {
18
+ chdir (sys_get_temp_dir ());
19
+
20
+ $ this ->assertTrue (true );
21
+ }
22
+ }
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ phpunit ../../_files/CwdRestoreTest.php
3
+ --FILE--
4
+ <?php declare (strict_types=1 );
5
+ $ cwd = getcwd ();
6
+
7
+ $ _SERVER ['argv ' ][] = '--do-not-cache-result ' ;
8
+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
9
+ $ _SERVER ['argv ' ][] = '--no-output ' ;
10
+ $ _SERVER ['argv ' ][] = __DIR__ . '/../../_files/CwdRestoreTest.php ' ;
11
+
12
+ require_once __DIR__ . '/../../bootstrap.php ' ;
13
+
14
+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
15
+
16
+ var_dump ($ cwd === getcwd ());
17
+ --EXPECTF --
18
+ bool (true )
You can’t perform that action at this time.
0 commit comments