_modulesReader = $this->createMock(\Magento\Framework\Module\Dir\Reader::class); $objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this); $this->_helper = $objectManager->getObject( \Magento\Persistent\Helper\Data::class, ['modulesReader' => $this->_modulesReader] ); } public function testGetPersistentConfigFilePath() { $this->_modulesReader->expects( $this->once() )->method( 'getModuleDir' )->with( 'etc', 'Magento_Persistent' )->will( $this->returnValue('path123') ); $this->assertEquals('path123/persistent.xml', $this->_helper->getPersistentConfigFilePath()); } }