create([ 'username' => 'pinuser', 'email_verified_at' => now(), 'vault_pin_hash' => \Illuminate\Support\Facades\Hash::make('4321'), ]); } public function test_set_success() { $user = $this->actingUser(); // Da ein PIN gesetzt ist, müssen wir current_pin mitsenden $res = $this->actingAs($user, 'web') ->postJson('/api/wallet/vault/pin/set', [ 'pin' => '1234', 'current_pin' => '4321' ]); $res->assertStatus(200) ->assertJson([ 'success' => true, ]); } public function test_verify_success() { $user = $this->actingUser(); // Der actingUser() hat PIN 4321 $res = $this->actingAs($user, 'web') ->postJson('/api/wallet/vault/pin/verify', [ 'pin' => '4321' ]); $res->assertStatus(200) ->assertJson([ 'success' => true, ]); } }