File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 8
8
use Cycle \Database \Driver \DriverInterface ;
9
9
use Cycle \Database \LoggerFactoryInterface ;
10
10
use Cycle \Database \NamedInterface ;
11
+ use Illuminate \Log \Logger ;
11
12
use Illuminate \Log \LogManager ;
12
13
use Illuminate \Support \Facades \Event ;
13
14
use Mockery as m ;
@@ -37,6 +38,8 @@ protected function tearDown(): void
37
38
*/
38
39
public function it_should_return_custom_logger_from_factory (): void
39
40
{
41
+ $ this ->app ['config ' ]->set ('cycle.database.logger.use_telescope ' , false );
42
+
40
43
$ mockDriver = m::mock (DriverInterface::class, NamedInterface::class);
41
44
$ mockDriver ->shouldReceive ('getName ' )->andReturn ('custom ' );
42
45
@@ -49,6 +52,8 @@ public function it_should_return_custom_logger_from_factory(): void
49
52
$ logger = $ loggerFactory ->getLogger ($ mockDriver );
50
53
$ logger ->info ('Test log entry ' );
51
54
55
+ $ this ::assertInstanceOf (Logger::class, $ logger );
56
+
52
57
$ logContent = file_get_contents (storage_path ('logs/logger-factory-test.log ' ));
53
58
$ this ::assertStringContainsString ('Test log entry ' , $ logContent );
54
59
}
You can’t perform that action at this time.
0 commit comments