reader = $this->getMockBuilder(Reader::class) ->disableOriginalConstructor() ->getMock(); $this->configType = 'configType'; $this->source = new InitialConfigSource($this->reader, $this->configType); } public function testGet() { $path = 'path'; $this->reader->expects($this->once()) ->method('load') ->willReturn([$this->configType => [$path => 'value']]); $this->assertEquals('value', $this->source->get($path)); } }