本文整理匯總了PHP中Magento\TestFramework\TestCase\AbstractBackendController::testAclHasAccess方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractBackendController::testAclHasAccess方法的具體用法?PHP AbstractBackendController::testAclHasAccess怎麽用?PHP AbstractBackendController::testAclHasAccess使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\TestFramework\TestCase\AbstractBackendController
的用法示例。
在下文中一共展示了AbstractBackendController::testAclHasAccess方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAclHasAccess
/**
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Paypal/_files/billing_agreement.php
*/
public function testAclHasAccess()
{
/** @var $session \Magento\Backend\Model\Session */
Bootstrap::getObjectManager()->create('Magento\\Backend\\Model\\Session');
parent::testAclHasAccess();
$response = $this->getResponse();
$this->assertSelectCount('button[type="button"][title="Reset Filter"]', 1, $response->getBody(), "Response for billing agreement grid doesn't contain 'Reset Filter' button");
$this->assertSelectCount('[id="billing_agreements"]', 1, $response->getBody(), "Response for billing agreement grid doesn't contain grid");
}
示例2: testAclHasAccess
/**
* @magentoDataFixture Magento/Customer/_files/customer.php
* @magentoDataFixture Magento/Paypal/_files/billing_agreement.php
*/
public function testAclHasAccess()
{
/** @var \Magento\Paypal\Model\ResourceModel\Billing\Agreement\Collection $billingAgreementCollection */
$billingAgreementCollection = Bootstrap::getObjectManager()->create('Magento\\Paypal\\Model\\ResourceModel\\Billing\\Agreement\\Collection');
$agreementId = $billingAgreementCollection->getFirstItem()->getId();
$this->uri = $this->uri . '/agreement/' . $agreementId;
parent::testAclHasAccess();
$this->assertSelectCount('a[name="billing_agreement_info"]', 1, $this->getResponse()->getBody(), "Response for billing agreement info doesn't contain billing agreement info tab");
$this->assertSelectRegExp('a', '/customer\\@example.com/', 1, $this->getResponse()->getBody(), "Response for billing agreement info doesn't contain Customer info");
}
示例3: testAclHasAccess
public function testAclHasAccess()
{
// setup
/** @var \Magento\Framework\Filesystem $filesystem */
$filesystem = Bootstrap::getObjectManager()->get('Magento\\Framework\\Filesystem');
$dirStatic = $filesystem->getDirectoryWrite(DirectoryList::STATIC_VIEW);
$subStaticDir = 'subdir';
$dirStatic->create($subStaticDir);
$this->assertTrue($dirStatic->isExist($subStaticDir));
$dirVar = $filesystem->getDirectoryWrite(DirectoryList::VAR_DIR);
$subVarDir = DirectoryList::TMP_MATERIALIZATION_DIR . '/subdir';
$dirVar->create($subVarDir);
$this->assertTrue($dirVar->isExist($subVarDir));
// test
parent::testAclHasAccess();
$this->assertSessionMessages($this->contains("The static files cache has been cleaned."), \Magento\Framework\Message\MessageInterface::TYPE_SUCCESS, 'Magento\\Framework\\Message\\ManagerInterface');
$this->assertFalse($dirStatic->isExist($subStaticDir));
$this->assertTrue($dirVar->isExist(DirectoryList::TMP_MATERIALIZATION_DIR));
$this->assertFalse($dirVar->isExist($subVarDir));
}