19declare(strict_types=1);
23use PHPUnit\Framework\TestCase;
32 $expected_component_id =
'comp_id';
33 $expected_logger = $this->createStub(LoggerInterface::class);
34 $expected_level_fectcher = $this->createStub(LevelFetcherInterface::class);
36 $internal_factory = $this->createMock(LazyInternalFactoryInterface::class);
38 ->expects($this->atLeastOnce())
39 ->method(
'getLazyGhost')
40 ->with($expected_component_id, $expected_level_fectcher)
41 ->willReturn($expected_logger);
43 $basic_config = $this->createMock(BasicConfigInterface::class);
45 ->expects($this->never())
46 ->method($this->anything());
48 $level_fetcher_factory = $this->createMock(LevelFetcherFactoryInterface::class);
49 $level_fetcher_factory
50 ->expects($this->atLeastOnce())
51 ->method(
'defaultLevelFetcher')
53 ->willReturn($expected_level_fectcher);
56 $actual_logger = $factory->getLazy($expected_component_id);
61 'This should return the logger from LazyInternalFactory'
This exists to encapsulate reading the level of a logger from the config, to be able to delay it as m...