/** * @param $url * @param $host * @dataProvider hostsDataProvider */ public function testIsHostBackend($url, $host, $expectedValue) { $backendUrl = $url; $_SERVER['HTTP_HOST'] = $host; $this->scopeConfigMock->expects($this->once())->method('getValue')->with(Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE)->willReturn($backendUrl); $this->assertEquals($this->model->isHostBackend(), $expectedValue); }
public function isHostBackend() { if ($this->isDeveloper) { return "http://" . $_SERVER['HTTP_HOST'] . "/"; } return parent::isHostBackend(); }
/** * @param string $url * @param string $host * @param string $useCustomAdminUrl * @param string $customAdminUrl * @param string $expectedValue * @dataProvider hostsDataProvider */ public function testIsHostBackend($url, $host, $useCustomAdminUrl, $customAdminUrl, $expectedValue) { $_SERVER['HTTP_HOST'] = $host; $this->scopeConfigMock->expects($this->exactly(2))->method('getValue')->will($this->returnValueMap([[Store::XML_PATH_UNSECURE_BASE_URL, ScopeInterface::SCOPE_STORE, null, $url], [FrontNameResolver::XML_PATH_USE_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE, null, $useCustomAdminUrl], [FrontNameResolver::XML_PATH_CUSTOM_ADMIN_URL, ScopeInterface::SCOPE_STORE, null, $customAdminUrl]])); $this->assertEquals($this->model->isHostBackend(), $expectedValue); }