File tree Expand file tree Collapse file tree 5 files changed +40
-2
lines changed
src/Tempest/Log/src/Config Expand file tree Collapse file tree 5 files changed +40
-2
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,8 @@ CONFIG_CACHE=false
1818VIEW_CACHE = false
1919
2020# Enable or disable project cache (allround cache)
21- PROJECT_CACHE = false
21+ PROJECT_CACHE = false
22+
23+ # Overwrite default log paths (null = default)
24+ DEBUG_LOG_PATH = null
25+ SERVER_LOG_PATH = null
Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ debug.log
1313tempest.log
1414public /static
1515tests /Unit /Log
16+ log /
Original file line number Diff line number Diff line change 3333 <env name =" BASE_URI" value =" " />
3434 <env name =" CACHE" value =" null" />
3535 <env name =" DISCOVERY_CACHE" value =" true" />
36+ <env name =" DEBUG_LOG_PATH" value =" log/debug.test.log" />
37+ <env name =" SERVER_LOG_PATH" value =" log/server.test.log" />
3638 <ini name =" memory_limit" value =" 256M" />
3739 </php >
3840</phpunit >
Original file line number Diff line number Diff line change 55namespace Tempest \Config ;
66
77use Tempest \Log \LogConfig ;
8+ use function Tempest \env ;
89
9- return new LogConfig ();
10+ return new LogConfig (
11+ debugLogPath: env ('DEBUG_LOG_PATH ' ),
12+ serverLogPath: env ('SERVER_LOG_PATH ' ),
13+ );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Log ;
6+
7+ use Tempest \Log \LogConfig ;
8+ use Tests \Tempest \Integration \FrameworkIntegrationTestCase ;
9+
10+ /**
11+ * @internal
12+ */
13+ final class LogConfigTest extends FrameworkIntegrationTestCase
14+ {
15+ public function test_log_path_by_env (): void
16+ {
17+ $ expectedDebugLogPath = 'log/debug.test.log ' ;
18+ $ expectedServerLogPath = 'log/server.test.log ' ;
19+
20+ $ this ->kernel ->loadConfig ();
21+
22+ $ logConfig = $ this ->container ->get (LogConfig::class);
23+
24+ $ this ->assertSame ($ expectedDebugLogPath , $ logConfig ->debugLogPath );
25+ $ this ->assertSame ($ expectedServerLogPath , $ logConfig ->serverLogPath );
26+ }
27+ }
You can’t perform that action at this time.
0 commit comments