File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
dev/tests/integration/testsuite/Magento/User/Controller/Adminhtml Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,32 @@ public function testSaveAction()
95
95
$ this ->assertRedirect ($ this ->stringContains ('backend/admin/user/index/ ' ));
96
96
}
97
97
98
+ /**
99
+ * @magentoDbIsolation enabled
100
+ * @magentoDataFixture Magento/User/_files/user_with_role.php
101
+ */
102
+ public function testSaveActionDuplicateUser ()
103
+ {
104
+ $ this ->getRequest ()->setPostValue (
105
+ [
106
+ 'username ' => 'adminUser ' ,
107
+ 'email ' => 'adminUser@example.com ' ,
108
+ 'firstname ' => 'John ' ,
109
+ 'lastname ' => 'Doe ' ,
110
+ 'password ' => \Magento \TestFramework \Bootstrap::ADMIN_PASSWORD ,
111
+ 'password_confirmation ' => \Magento \TestFramework \Bootstrap::ADMIN_PASSWORD ,
112
+ \Magento \User \Block \User \Edit \Tab \Main::CURRENT_USER_PASSWORD_FIELD => Bootstrap::ADMIN_PASSWORD ,
113
+ ]
114
+ );
115
+ $ this ->dispatch ('backend/admin/user/save/active_tab/main_section ' );
116
+ $ this ->assertSessionMessages (
117
+ $ this ->equalTo (['A user with the same user name or email already exists. ' ]),
118
+ \Magento \Framework \Message \MessageInterface::TYPE_ERROR
119
+ );
120
+ $ this ->assertRedirect ($ this ->stringContains ('backend/admin/user/edit/ ' ));
121
+ $ this ->assertRedirect ($ this ->matchesRegularExpression ('/^((?!active_tab).)*$/ ' ));
122
+ }
123
+
98
124
/**
99
125
* @magentoDbIsolation enabled
100
126
* @dataProvider resetPasswordDataProvider
You can’t perform that action at this time.
0 commit comments