File tree 7 files changed +23
-57
lines changed
7 files changed +23
-57
lines changed Original file line number Diff line number Diff line change 8
8
if (is_file (__DIR__ . '/../vendor/autoload.php ' )) {
9
9
require_once __DIR__ . '/../vendor/autoload.php ' ;
10
10
} else {
11
- require_once __DIR__ . '/set-env.php ' ;
12
11
require_once __DIR__ . '/init.php ' ;
13
12
require_once __DIR__ . '/constants.php ' ;
14
13
require_once BOOT_DIR . 'helpers.php ' ;
Original file line number Diff line number Diff line change 5
5
* For the full copyright and license information, please view the LICENSE
6
6
* file that was distributed with this source code.
7
7
*/
8
+ if (is_file (__DIR__ . '/../.env.php ' )) {
9
+ require __DIR__ . '/../.env.php ' ;
10
+ foreach ($ _ENV as $ key => $ value ) {
11
+ $ _SERVER [$ key ] = $ value ;
12
+ }
13
+ }
14
+
8
15
if (isset ($ _SERVER ['ENVIRONMENT ' ]) && $ _SERVER ['ENVIRONMENT ' ] === 'development ' ) {
9
16
error_reporting (-1 );
10
17
ini_set ('display_errors ' , 'On ' );
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 54
54
" App.php"
55
55
],
56
56
"files" : [
57
- " boot/set-env.php" ,
58
57
" boot/init.php" ,
59
58
" boot/constants.php" ,
60
59
" boot/helpers.php"
Original file line number Diff line number Diff line change 22
22
<file >.env.php</file >
23
23
<file >App.php</file >
24
24
<file >bin/console</file >
25
- <file >boot/set-env.php</file >
26
25
<file >boot/helpers.php</file >
27
26
<file >boot/routes.php</file >
28
27
<file >public/index.php</file >
Original file line number Diff line number Diff line change 13
13
#[RunTestsInSeparateProcesses]
14
14
final class InitTest extends TestCase
15
15
{
16
- protected function loadInitFile () : static
16
+ protected function setUp () : void
17
17
{
18
+ \ob_start ();
18
19
require __DIR__ . '/../../boot/init.php ' ;
19
- return $ this ;
20
+ \ob_end_clean () ;
20
21
}
21
22
22
- public function testDevelopmentEnvironment () : void
23
+ public function testErrorReporting () : void
23
24
{
24
- $ _SERVER ['ENVIRONMENT ' ] = 'development ' ;
25
- $ this ->loadInitFile ();
26
- self ::assertSame (-1 , \error_reporting ());
27
- self ::assertSame ('On ' , \ini_get ('display_errors ' ));
28
- }
29
-
30
- public function testProductionEnvironment () : void
31
- {
32
- $ _SERVER ['ENVIRONMENT ' ] = 'production ' ;
33
- $ this ->loadInitFile ();
25
+ if ($ _SERVER ['ENVIRONMENT ' ] === 'development ' ) {
26
+ self ::assertSame (-1 , \error_reporting ());
27
+ return ;
28
+ }
34
29
self ::assertSame (
35
30
\E_ALL & ~\E_DEPRECATED & ~\E_NOTICE & ~\E_USER_DEPRECATED & ~\E_USER_NOTICE ,
36
31
\error_reporting ()
37
32
);
33
+ }
34
+
35
+ public function testDisplayErrors () : void
36
+ {
37
+ if ($ _SERVER ['ENVIRONMENT ' ] === 'development ' ) {
38
+ self ::assertSame ('On ' , \ini_get ('display_errors ' ));
39
+ return ;
40
+ }
38
41
self ::assertSame ('Off ' , \ini_get ('display_errors ' ));
39
42
}
40
43
41
44
public function testDefaultTimezone () : void
42
45
{
43
- $ this ->loadInitFile ();
44
46
self ::assertSame ('UTC ' , \date_default_timezone_get ());
45
47
}
46
48
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments