Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
StoreTest Class Reference
Inheritance diagram for StoreTest:
AbstractBackendController AbstractController

Public Member Functions

 testIndexAction ()
 
 saveActionWithExistCodeDataProvider ()
 
- Public Member Functions inherited from AbstractBackendController
 assertSessionMessages (\PHPUnit\Framework\Constraint\Constraint $constraint, $messageType=null, $messageManagerClass=\Magento\Framework\Message\Manager::class)
 
 testAclHasAccess ()
 
 testAclNoAccess ()
 
- Public Member Functions inherited from AbstractController
 getRequest ()
 
 getResponse ()
 
 assert404NotFound ()
 
 assertHeaderPcre ($headerName, $valueRegex)
 
 assertRedirect (\PHPUnit\Framework\Constraint\Constraint $urlConstraint=null)
 

Additional Inherited Members

- Protected Member Functions inherited from AbstractBackendController
 setUp ()
 
 _getAdminCredentials ()
 
 tearDown ()
 
- Protected Member Functions inherited from AbstractController
 _getBootstrap ()
 
 setUp ()
 
 tearDown ()
 
 assertPostConditions ()
 
 getMessages ( $messageType=null, $messageManagerClass=\Magento\Framework\Message\Manager::class)
 
- Protected Attributes inherited from AbstractBackendController
 $_session
 
 $_auth
 
 $resource = null
 
 $uri = null
 
 $httpMethod
 
- Protected Attributes inherited from AbstractController
 $_runCode = ''
 
 $_runScope = 'store'
 
 $_runOptions = []
 
 $_request
 
 $_response
 
 $_objectManager
 
 $_assertSessionErrors = false
 

Detailed Description

@magentoAppArea adminhtml

Definition at line 11 of file StoreTest.php.

Member Function Documentation

◆ saveActionWithExistCodeDataProvider()

saveActionWithExistCodeDataProvider ( )
Returns
array

Definition at line 87 of file StoreTest.php.

88  {
89  return [
90  [
91  'post' => [
92  'website' => [
93  'name' => 'base',
94  'code' => 'base',
95  'sort_order' => '',
96  'is_default' => '',
97  'website_id' => '',
98  ],
99  'store_type' => 'website',
100  'store_action' => 'add',
101  ],
102  'message' => 'Website with the same code already exists.',
103  ],
104  [
105  'post' => [
106  'group' => [
107  'website_id' => '1',
108  'name' => 'default',
109  'code' => 'default',
110  'root_category_id' => '1',
111  'group_id' => '',
112  ],
113  'store_type' => 'group',
114  'store_action' => 'add',
115  ],
116  'message' => 'Group with the same code already exists.',
117  ],
118  [
119  'post' => [
120  'store' => [
121  'name' => 'default',
122  'code' => 'default',
123  'is_active' => '1',
124  'sort_order' => '',
125  'is_default' => '',
126  'group_id' => '1',
127  'store_id' => '',
128  ],
129  'store_type' => 'store',
130  'store_action' => 'add',
131  ],
132  'message' => 'Store with the same code already exists.',
133  ],
134  ];
135  }

◆ testIndexAction()

testIndexAction ( )

Definition at line 13 of file StoreTest.php.

14  {
15  $this->dispatch('backend/admin/system_store/index');
16 
17  $response = $this->getResponse()->getBody();
18 
19  $this->assertEquals(
20  1,
21  \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
22  '//*[@id="add" and @title = "Create Website"]/span[text() = "Create Website"]',
23  $response
24  )
25  );
26  $this->assertEquals(
27  1,
28  \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
29  '//*[@id="add_group"]',
30  $response
31  )
32  );
33  $this->assertEquals(
34  1,
35  \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
36  '//*[@id="add_store"]',
37  $response
38  )
39  );
40  $this->assertEquals(
41  0,
42  \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
43  '//*[@id = "add" and @class = "disabled"]',
44  $response
45  )
46  );
47  $this->assertEquals(
48  0,
49  \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
50  '//*[@id="add_group" and contains(@class,"disabled")]',
51  $response
52  )
53  );
54  $this->assertEquals(
55  0,
56  \Magento\TestFramework\Helper\Xpath::getElementsCountForXpath(
57  '//*[@id="add_store" and contains(@class,"disabled")]',
58  $response
59  )
60  );
61  }
$response
Definition: 404.php:11
dispatch(\Magento\Framework\App\RequestInterface $request)

The documentation for this class was generated from the following file: