本文整理汇总了PHP中Magento\Framework\App\Request\Http::clearParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Http::clearParams方法的具体用法?PHP Http::clearParams怎么用?PHP Http::clearParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Magento\Framework\App\Request\Http
的用法示例。
在下文中一共展示了Http::clearParams方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIsAjax
public function testIsAjax()
{
$this->_model = $this->getModel();
$this->assertFalse($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->setParam('ajax', 1);
$this->assertTrue($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->setParam('isAjax', 1);
$this->assertTrue($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->getHeaders()->addHeaderLine('X-Requested-With', 'XMLHttpRequest');
$this->assertTrue($this->_model->isAjax());
$this->_model->getHeaders()->clearHeaders();
$this->_model->getHeaders()->addHeaderLine('X-Requested-With', 'NotXMLHttpRequest');
$this->assertFalse($this->_model->isAjax());
}
示例2: testIsAjax
public function testIsAjax()
{
$this->_model = $this->_model = $this->getModel();
$this->assertFalse($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->setParam('ajax', 1);
$this->assertTrue($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->setParam('isAjax', 1);
$this->assertTrue($this->_model->isAjax());
$this->_model->clearParams();
$server = $_SERVER;
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
$this->assertTrue($this->_model->isAjax());
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'NotXMLHttpRequest';
$this->assertFalse($this->_model->isAjax());
$_SERVER = $server;
}
示例3: testIsAjax
public function testIsAjax()
{
$this->_model = new Request($this->_routerListMock, $this->_infoProcessorMock);
$this->assertFalse($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->setParam('ajax', 1);
$this->assertTrue($this->_model->isAjax());
$this->_model->clearParams();
$this->_model->setParam('isAjax', 1);
$this->assertTrue($this->_model->isAjax());
$this->_model->clearParams();
$server = $_SERVER;
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
$this->assertTrue($this->_model->isAjax());
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'NotXMLHttpRequest';
$this->assertFalse($this->_model->isAjax());
$_SERVER = $server;
}