'PHP_AUTH_PW' => 'ThePassword'
]],
];
} public function testUpgradePassword() { $request =
new Request([],
[],
[],
[],
[],
[ 'PHP_AUTH_USER' => 'TheUsername',
'PHP_AUTH_PW' => 'ThePassword',
]);
$this->userProvider =
new PasswordUpgraderProvider(['test' =>
['password' => 's$cr$t'
]]);
$authenticator =
new HttpBasicAuthenticator('test',
$this->userProvider
);
$passport =
$authenticator->
authenticate($request);
$this->
assertTrue($passport->
hasBadge(PasswordUpgradeBadge::
class));
$badge =
$passport->
getBadge(PasswordUpgradeBadge::
class);
$this->
assertEquals('ThePassword',
$badge->
getAndErasePlaintextPassword());
}}