File tree Expand file tree Collapse file tree 5 files changed +79
-0
lines changed
tests/end-to-end/regression Expand file tree Collapse file tree 5 files changed +79
-0
lines changed Original file line number Diff line number Diff line change @@ -1297,6 +1297,7 @@ private function runTest(): mixed
1297
1297
1298
1298
$ capture = tmpfile ();
1299
1299
assert ($ capture !== false );
1300
+ ini_set ('display_errors ' , 1 );
1300
1301
$ errorLogPrevious = ini_set ('error_log ' , stream_get_meta_data ($ capture )['uri ' ]);
1301
1302
1302
1303
try {
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Silent failure of PHP fatal errors
3
+
4
+ https://github.com/sebastianbergmann/phpunit/issues/6294
5
+ --INI--
6
+ display_errors=0
7
+ --FILE--
8
+ <?php declare (strict_types=1 );
9
+ $ _SERVER ['argv ' ][] = '--do-not-cache-result ' ;
10
+ $ _SERVER ['argv ' ][] = '--no-configuration ' ;
11
+ $ _SERVER ['argv ' ][] = __DIR__ . '/6294/IssueTest6294.php ' ;
12
+
13
+ require_once __DIR__ . '/../../bootstrap.php ' ;
14
+ (new PHPUnit \TextUI \Application )->run ($ _SERVER ['argv ' ]);
15
+ --EXPECTF --
16
+ PHPUnit %s by Sebastian Bergmann and contributors.
17
+
18
+ Runtime: %s
19
+
20
+
21
+ Fatal error: Access level to B::someFunction() must be public (as in class A) in %sB.php on line %i
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 <[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
+ class A
11
+ {
12
+ public function someFunction (): void
13
+ {
14
+ print 'A::someFunction ' . \PHP_EOL ;
15
+ }
16
+ }
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 <[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
+ class B extends A
11
+ {
12
+ // incorrect access level
13
+ protected function someFunction (): void
14
+ {
15
+ parent ::someFunction ();
16
+
17
+ print 'B::someFunction ' . \PHP_EOL ;
18
+ }
19
+ }
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 <[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
+ use PHPUnit \Framework \TestCase ;
11
+
12
+ final class IssueTest6294 extends TestCase
13
+ {
14
+ public function testOne (): void
15
+ {
16
+ require_once 'A.php ' ;
17
+
18
+ require_once 'B.php ' ;
19
+
20
+ $ this ->assertSame (1 , 1 );
21
+ }
22
+ }
You can’t perform that action at this time.
0 commit comments