Skip to content

Commit 7e326de

Browse files
committed
MAGETWO-33455: Cover Config-based Integration Creation with Test
- fixed a bug related to setup module
1 parent e12f527 commit 7e326de

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

dev/tests/unit/testsuite/Magento/Setup/Model/AdminAccountTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public function testSaveUserExistsAdminRoleExists()
9090
$existingUserData,
9191
],
9292
[
93-
'SELECT * FROM authorization_role WHERE user_id = :user_id',
94-
['user_id' => 1],
93+
'SELECT * FROM authorization_role WHERE user_id = :user_id AND user_type = :user_type',
94+
['user_id' => 1, 'user_type' => 2],
9595
null,
9696
$existingAdminRoleData,
9797
],
@@ -137,8 +137,8 @@ public function testSaveUserExistsNewAdminRole()
137137
$existingUserData,
138138
],
139139
[
140-
'SELECT * FROM authorization_role WHERE user_id = :user_id',
141-
['user_id' => 1],
140+
'SELECT * FROM authorization_role WHERE user_id = :user_id AND user_type = :user_type',
141+
['user_id' => 1, 'user_type' => 2],
142142
null,
143143
[],
144144
],
@@ -193,8 +193,8 @@ public function testSaveNewUserAdminRoleExists()
193193
[],
194194
],
195195
[
196-
'SELECT * FROM authorization_role WHERE user_id = :user_id',
197-
['user_id' => 1],
196+
'SELECT * FROM authorization_role WHERE user_id = :user_id AND user_type = :user_type',
197+
['user_id' => 1, 'user_type' => 2],
198198
null,
199199
$existingAdminRoleData,
200200
],
@@ -233,8 +233,8 @@ public function testSaveNewUserNewAdminRole()
233233
[],
234234
],
235235
[
236-
'SELECT * FROM authorization_role WHERE user_id = :user_id',
237-
['user_id' => 1],
236+
'SELECT * FROM authorization_role WHERE user_id = :user_id AND user_type = :user_type',
237+
['user_id' => 1, 'user_type' => 2],
238238
null,
239239
[],
240240
],

setup/src/Magento/Setup/Model/AdminAccount.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ private function saveAdminUserRole($adminId)
169169
{
170170
$result = $this->setup->getConnection()->fetchRow(
171171
'SELECT * FROM ' . $this->setup->getTable('authorization_role') . ' ' .
172-
'WHERE user_id = :user_id',
173-
['user_id' => $adminId]
172+
'WHERE user_id = :user_id AND user_type = :user_type',
173+
['user_id' => $adminId, 'user_type' => UserContextInterface::USER_TYPE_ADMIN]
174174
);
175175
if (empty($result)) {
176176
// No user role exists for this user id, create it

0 commit comments

Comments
 (0)