@normykinz If you refresh the user data before asserting, does it works?
For example:
// Refresh the user model from the database
$this->user->refresh();
$this->assertTrue(Hash::check('updated@password', $this->user->password));
Summer Sale! All accounts are 50% off this week.
I'm not sure if this is possible.
I've made sure my phpunit.xml environment settings as the same as the dev encironment (including APP_KEY and BCRYPT_ROUNDS) but shis test fails.
it('encrypts the updated user password', function () {
actingAs($this->user)
->livewire(Password::class)
->set('password', 'updated@password')
->set('password_confirmation', 'updated@password')
->call('submit');
$this->assertTrue(Hash::check('updated@password', $this->user->password));
});
The Livewire component works as expected in the browser. It updates and hashes the passord as expected. But I don't know if it's even possible to test. Any pointers gratefully recieved,
@normykinz If you refresh the user data before asserting, does it works?
For example:
// Refresh the user model from the database
$this->user->refresh();
$this->assertTrue(Hash::check('updated@password', $this->user->password));
Please or to participate in this conversation.