markTestSkipped('Run php artisan migrate to add Asteria customer columns.'); } $this->seedRequiredData(); } public function test_attempt_upgrades_a_legacy_hash_to_bcrypt(): void { $customer = $this->createCustomer([ 'password' => Hash::make('placeholder-secret'), 'legacy_password' => md5('abcsecret12').':abc', ]); $this->assertTrue(Magento1Password::attempt($customer, 'secret12')); $customer->refresh(); $this->assertTrue(Hash::check('secret12', $customer->password)); $this->assertNull($customer->legacy_password); } public function test_attempt_accepts_an_existing_bcrypt_password(): void { $customer = $this->createCustomer([ 'password' => Hash::make('secret12'), 'legacy_password' => null, ]); $this->assertTrue(Magento1Password::attempt($customer, 'secret12')); $this->assertFalse(Magento1Password::attempt($customer, 'wrong-password')); } public function test_customer_user_provider_upgrades_legacy_password(): void { $customer = $this->createCustomer([ 'password' => Hash::make('placeholder-secret'), 'legacy_password' => md5('abcsecret12').':abc', ]); $provider = new CustomerUserProvider(app('hash'), Customer::class); $this->assertTrue($provider->validateCredentials($customer, ['password' => 'secret12'])); $customer->refresh(); $this->assertTrue(Hash::check('secret12', $customer->password)); $this->assertNull($customer->legacy_password); } }