php Magento-TestFramework-TestCase-AbstractBackendController类(方法)实例源码

下面列出了php Magento-TestFramework-TestCase-AbstractBackendController 类(方法)源码代码实例,从而了解它的用法。

作者:kidaa3    项目:magento2-platforms   
protected function tearDown()
 {
     if ($this->_httpXRequestedWith !== null) {
         $_SERVER['HTTP_X_REQUESTED_WITH'] = $this->_httpXRequestedWith;
     }
     parent::tearDown();
 }

作者:andrewhowdenco    项目:m2onk8   
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');
 }

作者:BlackIkeEagl    项目:magento2-continuousph   
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');
 }

作者:niranjanssie    项目:magento   
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');
 }

作者:kidaa3    项目:magento2-platforms   
/**
  * @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");
 }

作者:kidaa3    项目:magento2-platforms   
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();
 }

作者:andrewhowdenco    项目:m2onk8   
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();
 }

作者:andrewhowdenco    项目:m2onk8   
/**
  * @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");
 }

作者:nja7    项目:magento   
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());
 }

作者:rafaelst    项目:magento   
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');
 }

作者:kidaa3    项目:magento2-platforms   
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));
 }

作者:BlackIkeEagl    项目:magento2-continuousph   
/**
  * Set up
  */
 protected function setUp()
 {
     $this->uri = 'backend/security/session/check';
     parent::setUp();
 }

作者:Doabilit    项目:magento2de   
public function setUp()
 {
     $this->resource = 'Mirasvit_Search::search_synonym';
     $this->uri = 'backend/search/synonym/new';
     parent::setUp();
 }

作者:VoblaSmil    项目:php56-magento2-dat   
/**
  * Tear down
  */
 protected function tearDown()
 {
     $this->_model = null;
     parent::tearDown();
 }

作者:andrewhowdenco    项目:m2onk8   
protected function setUp()
 {
     $this->_block = Bootstrap::getObjectManager()->create('Magento\\Paypal\\Block\\Billing\\Agreement\\View');
     parent::setUp();
 }

作者:andrewhowdenco    项目:m2onk8   
public function tearDown()
 {
     parent::tearDown();
     //$this->session->unsCustomerGroupData();
 }

作者:kidaa3    项目:magento2-platforms   
public function setUp()
 {
     parent::setUp();
     $this->quoteItemCollectionFactory = $this->_objectManager->get('Magento\\Quote\\Model\\ResourceModel\\Quote\\Item\\CollectionFactory');
 }

作者:andrewhowdenco    项目:m2onk8   
protected function setUp()
 {
     parent::setUp();
     $this->customerRepository = Bootstrap::getObjectManager()->get('Magento\\Customer\\Api\\CustomerRepositoryInterface');
 }


问题


面经


文章

微信
公众号

扫码关注公众号