/** * @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"); }
/** * @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"); }
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)); }