UsersTableSeeder.php 569 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Tests\DatabaseSeeders;
  3. use StatonLab\TripalTestSuite\Database\Seeder;
  4. class UsersTableSeeder extends Seeder
  5. {
  6. /**
  7. * Seeds the database with users.
  8. */
  9. public function up()
  10. {
  11. $new_user = [
  12. 'name' => 'test user',
  13. 'pass' => 'secret',
  14. 'mail' => 'test@example.com',
  15. 'status' => 1,
  16. 'init' => 'Email',
  17. 'roles' => [
  18. DRUPAL_AUTHENTICATED_RID => 'authenticated user',
  19. ],
  20. ];
  21. // The first parameter is sent blank so a new user is created.
  22. user_save(new \stdClass(), $new_user);
  23. }
  24. }