8 class DataTest extends \PHPUnit\Framework\TestCase
30 protected function setUp()
32 $objectManagerHelper = new \Magento\Framework\TestFramework\Unit\Helper\ObjectManager($this);
33 $className = \Magento\Developer\Helper\Data::class;
37 $this->scopeConfigMock = $context->getScopeConfig();
38 $this->remoteAddressMock = $context->getRemoteAddress();
39 $this->httpHeaderMock = $context->getHttpHeader();
52 $this->scopeConfigMock->expects($this->once())
55 \
Magento\Developer\Helper\Data::XML_PATH_DEV_ALLOW_IPS,
56 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE,
58 )->will($this->returnValue($allowedIps));
60 $this->remoteAddressMock->expects($this->once())
61 ->method(
'getRemoteAddress')
62 ->will($this->returnValue(
'remoteAddress'));
64 $this->httpHeaderMock->expects($this->exactly($callNum))
65 ->method(
'getHttpHost')
66 ->will($this->returnValue(
'httpHost'));
68 $this->assertEquals($expected, $this->helper->isDevAllowed(
$storeId));
82 'allow_remote_address' => [
83 'ip1, ip2, remoteAddress',
87 'allow_http_host' => [
isDevAllowedDataProvider()
testIsDevAllowed($allowedIps, $expected, $callNum=1)