readerMock = $this->getMockBuilder(\Magento\Framework\Module\Dir\Reader::class) ->disableOriginalConstructor() ->getMock(); $this->fileResolver = new \Magento\Paypal\Model\Config\Rules\FileResolver($this->readerMock); } /** * Run test for get method * * @return void */ public function testGet() { $filename = 'test-filename'; $expected = ['file1', 'file2']; $this->readerMock->expects($this->once()) ->method('getConfigurationFiles') ->with($filename) ->willReturn($expected); $this->assertEquals($expected, $this->fileResolver->get($filename, null)); } }