Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
user_with_role.php
Go to the documentation of this file.
1 <?php
13 $model->setFirstname("John")
14  ->setLastname("Doe")
15  ->setUsername('adminUser')
16  ->setPassword(\Magento\TestFramework\Bootstrap::ADMIN_PASSWORD)
17  ->setEmail('[email protected]')
18  ->setRoleType('G')
19  ->setResourceId('Magento_Backend::all')
20  ->setPrivileges("")
21  ->setAssertId(0)
22  ->setRoleId(1)
23  ->setPermission('allow');
24 $model->save();
$model