UsersTableSeeder.php 568 B

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