/** * Get original configPath (not changed by PayPal configuration inheritance) * * @param \Magento\Config\Model\Config\Structure\Element\Field $subject * @param \Closure $proceed * @return string|null */ public function aroundGetConfigPath(\Magento\Config\Model\Config\Structure\Element\Field $subject, \Closure $proceed) { $configPath = $proceed(); if (!isset($configPath) && $this->_request->getParam('section') == 'payment') { $configPath = preg_replace('@^(' . implode('|', \Magento\Paypal\Model\Config\StructurePlugin::getPaypalConfigCountries(true)) . ')/@', 'payment/', $subject->getPath()); } return $configPath; }
public function testGetPaypalConfigCountries() { $countries = StructurePlugin::getPaypalConfigCountries(false); $this->assertContains('payment_us', $countries); $this->assertNotContains('payment_other', $countries); }