Skip to content

Commit bc373d1

Browse files
committed
Fix tests for sebastianbergmann#2591 to work regardless of php.ini error settings
The log_errors and display_errors settings were interfering with the actual test output, causing the tests to fail under some circumstances (i.e. default php.ini values).
1 parent 85997d9 commit bc373d1

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap-xdebug.phpt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,10 @@ PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase
3030
PHP Stack trace:
3131
%a
3232

33-
Fatal error: Class 'PHPUnit\Framework\TestCase' not found in %s on line %s
34-
35-
Call Stack:
36-
%a
37-
3833
2) Issue2591_SeparateFunctionNoPreserveTest::testGlobalString
3934
PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s
4035
PHP Stack trace:
4136
%a
4237

43-
Fatal error: Class 'PHPUnit\Framework\TestCase' not found in %s on line %s
44-
45-
Call Stack:
46-
%a
47-
4838
ERRORS!
4939
Tests: 2, Assertions: 0, Errors: 2.

tests/Regression/GitHub/2591-separate-function-no-preserve-no-bootstrap.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ There were 2 errors:
2727

2828
1) Issue2591_SeparateFunctionNoPreserveTest::testChangedGlobalString
2929
PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s
30-
Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s
3130

3231
2) Issue2591_SeparateFunctionNoPreserveTest::testGlobalString
3332
PHPUnit\Framework\Exception: PHP Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s
34-
Fatal error: Class 'PHPUnit\Framework\TestCase' not found %s
3533

3634
ERRORS!
3735
Tests: 2, Assertions: 0, Errors: 2.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
ini_set('display_errors', 0);
3+
ini_set('log_errors', 1);
4+
25
$globalString = 'Hello';
36

4-
// require __DIR__ . '/../../../bootstrap.php';
7+
// require __DIR__ . '/../../../bootstrap.php';

0 commit comments

Comments
 (0)