I'm trying to read a row in my unit test from core_config_table in magento 2 database. I know that to accomplish this job as I have read this link. I have to use:
\Magento\Framework\App\Config\ScopeConfigInterface
through:
\Magento\Framework\TestFramework\Unit\Helper\ObjectManager
Here is my code:
protected function setUp()
{
$objectManager = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
$this->scopeConfig = $objectManager->getObject('\Magento\Framework\App\Config\ScopeConfigInterface');
}
public function testgetImageCDNConfigValue()
{
$this->scopeConfig->getValue($this->path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
if ($this->scopeConfig == null) {
$this->assertFalse(true);
} else {
$this->assertTrue(true);
}
}
I can get every object I want by using testObject \Magento\Framework\TestFramework\Unit\Helper\ObjectManager
but whenever I want to get \Magento\Framework\App\Config\ScopeConfigInterface
Fatal error: Cannot instantiate interface Magento\Framework\App\Config\ScopeConf igInterface in C:\xampp\htdocs\magento\vendor\magento\framework\TestFramework\Un it\Helper\ObjectManager.php on line 162