/** * @param bool $isEnabled * @param bool $isActive * @param bool $isDevAllowed * @param bool $result * @dataProvider isAllowedDataProvider */ public function testIsAllowed($isEnabled, $isActive, $isDevAllowed, $result) { $this->prepareIsAllowed($isEnabled, $isActive, $isDevAllowed); $model = new Inline($this->scopeResolverMock, $this->urlMock, $this->layoutMock, $this->configMock, $this->parserMock, $this->stateMock); $this->assertEquals($result, $model->isAllowed()); $this->assertEquals($result, $model->isAllowed()); }
/** * Include RequireJs inline translation configuration as an asset on the page * @return void */ private function addInlineTranslationConfig() { if ($this->inline->isAllowed()) { $after = RequireJsConfig::REQUIRE_JS_FILE_NAME; $tConfig = $this->fileManager->createTranslateConfigAsset(); $assetCollection = $this->pageConfig->getAssetCollection(); $assetCollection->insert($tConfig->getFilePath(), $tConfig, $after); } }
public function testIsAllowed() { $this->assertTrue($this->_model->isAllowed()); $this->assertTrue($this->_model->isAllowed($this->_storeId)); $this->assertTrue($this->_model->isAllowed(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore($this->_storeId))); $this->state->suspend(); $this->assertFalse($this->_model->isAllowed()); $this->assertFalse($this->_model->isAllowed($this->_storeId)); $this->assertFalse($this->_model->isAllowed(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore($this->_storeId))); }