當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TestCase\AbstractBackendController類代碼示例

本文整理匯總了PHP中Magento\TestFramework\TestCase\AbstractBackendController的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractBackendController類的具體用法?PHP AbstractBackendController怎麽用?PHP AbstractBackendController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了AbstractBackendController類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 protected function tearDown()
 {
     if ($this->_httpXRequestedWith !== null) {
         $_SERVER['HTTP_X_REQUESTED_WITH'] = $this->_httpXRequestedWith;
     }
     parent::tearDown();
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:7,代碼來源:ExportTest.php

示例2: setUp

 protected function setUp()
 {
     parent::setUp();
     $post = ['code' => 'test data', 'subject' => 'test data2', 'sender_email' => 'sender@email.com', 'sender_name' => 'Test Sender Name', 'text' => 'Template Content'];
     $this->getRequest()->setPostValue($post);
     $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Newsletter\\Model\\Template');
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:7,代碼來源:NewsletterTemplateTest.php

示例3: setUp

 protected function setUp()
 {
     parent::setUp();
     /** @var $integration \Magento\Integration\Model\Integration */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $integration = $objectManager->create('Magento\\Integration\\Model\\Integration');
     $this->_integration = $integration->load('Fixture Integration', 'name');
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:8,代碼來源:IntegrationTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->_baseControllerUrl = 'http://localhost/index.php/backend/customer/index/';
     $this->customerRepository = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\CustomerRepositoryInterface');
     $this->addressRepository = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\AddressRepositoryInterface');
     $this->accountManagement = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\AccountManagementInterface');
 }
開發者ID:niranjanssiet,項目名稱:magento2,代碼行數:8,代碼來源:IndexTest.php

示例5: 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");
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:13,代碼來源:GridTest.php

示例6: tearDown

 protected function tearDown()
 {
     $this->_block = null;
     $this->_user = null;
     /** @var $objectManager \Magento\TestFramework\ObjectManager */
     $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();
     $objectManager->get('Magento\\Framework\\Registry')->unregister('permissions_user');
     parent::tearDown();
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:9,代碼來源:MainTest.php

示例7: tearDown

 protected function tearDown()
 {
     /** @var $cacheState \Magento\Framework\App\Cache\StateInterface */
     $cacheState = Bootstrap::getObjectManager()->get('Magento\\Framework\\App\\Cache\\StateInterface');
     foreach (self::$typesConfig as $type => $value) {
         $cacheState->setEnabled($type, $value);
     }
     $cacheState->persist();
     parent::tearDown();
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:10,代碼來源:MassActionTest.php

示例8: 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");
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:14,代碼來源:ViewTest.php

示例9: setUp

 protected function setUp()
 {
     parent::setUp();
     $theme = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\View\\DesignInterface')->setDefaultDesignTheme()->getDesignTheme();
     $type = 'Magento\\Cms\\Block\\Widget\\Page\\Link';
     /** @var $model \Magento\Widget\Model\Widget\Instance */
     $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\\Widget\\Model\\Widget\\Instance');
     $code = $model->setType($type)->getWidgetReference('type', $type, 'code');
     $this->getRequest()->setParam('code', $code);
     $this->getRequest()->setParam('theme_id', $theme->getId());
 }
開發者ID:nja78,項目名稱:magento2,代碼行數:11,代碼來源:InstanceTest.php

示例10: setUp

 protected function setUp()
 {
     parent::setUp();
     $this->_baseControllerUrl = 'http://localhost/index.php/backend/customer/index/';
     $this->customerRepository = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\CustomerRepositoryInterface');
     $this->addressRepository = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\AddressRepositoryInterface');
     $this->accountManagement = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\AccountManagementInterface');
     $this->formKey = Bootstrap::getObjectManager()->get('Magento\\Framework\\Data\\Form\\FormKey');
     $this->objectManager = Bootstrap::getObjectManager();
     $this->customerViewHelper = $this->objectManager->get('Magento\\Customer\\Helper\\View');
 }
開發者ID:rafaelstz,項目名稱:magento2,代碼行數:11,代碼來源:IndexTest.php

示例11: 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));
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:20,代碼來源:CleanStaticFilesTest.php

示例12: setUp

 /**
  * Set up
  */
 protected function setUp()
 {
     $this->uri = 'backend/security/session/check';
     parent::setUp();
 }
開發者ID:BlackIkeEagle,項目名稱:magento2-continuousphp,代碼行數:8,代碼來源:CheckTest.php

示例13: setUp

 public function setUp()
 {
     $this->resource = 'Mirasvit_Search::search_synonym';
     $this->uri = 'backend/search/synonym/new';
     parent::setUp();
 }
開發者ID:Doability,項目名稱:magento2dev,代碼行數:6,代碼來源:NewActionTest.php

示例14: tearDown

 /**
  * Tear down
  */
 protected function tearDown()
 {
     $this->_model = null;
     parent::tearDown();
 }
開發者ID:VoblaSmile,項目名稱:php56-magento2-data,代碼行數:8,代碼來源:SaveRatesTest.php

示例15: setUp

 protected function setUp()
 {
     $this->_block = Bootstrap::getObjectManager()->create('Magento\\Paypal\\Block\\Billing\\Agreement\\View');
     parent::setUp();
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:5,代碼來源:ViewTest.php


注:本文中的Magento\TestFramework\TestCase\AbstractBackendController類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。