public function run() { $faker = Factory::create(); //User::truncate(); foreach (range(1, 50) as $index) { User::create(['username' => $faker->userName, 'password' => $faker->password(8, 20), 'email' => $faker->email, 'profile_state' => $faker->boolean()]); } }
/** */ public function testRegister() { $email = '*****@*****.**'; $password = Hash::make('password'); $username = '******'; $status = TRUE; $profile_state = FALSE; User::create(['email' => $email, 'password' => $password, 'username' => $username, 'status' => $status, 'profile_state' => $profile_state]); $this->tester->seeRecord('users', ['email' => $email, 'username' => $username, 'password' => $password]); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { return User::create(['email' => $data['email'], 'username' => $data['name'], 'password' => bcrypt($data['password']), 'status' => TRUE, 'profile_state' => FALSE]); }