Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
make login link handler tests time sensitive
  • Loading branch information
xabbuh committed Dec 29, 2021
commit 40f2f4d89b6d0c542369fe839b311de10919003f
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public function __construct(UrlGeneratorInterface $urlGenerator, UserProviderInt

public function createLoginLink(UserInterface $user, Request $request = null): LoginLinkDetails
{
$expiresAt = new \DateTimeImmutable(sprintf('+%d seconds', $this->options['lifetime']));
$expires = time() + $this->options['lifetime'];
$expiresAt = new \DateTimeImmutable('@'.$expires);

$expires = $expiresAt->format('U');
$parameters = [
// @deprecated since Symfony 5.3, change to $user->getUserIdentifier() in 6.0
'user' => method_exists($user, 'getUserIdentifier') ? $user->getUserIdentifier() : $user->getUsername(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ protected function setUp(): void
}

/**
* @group time-sensitive
* @dataProvider provideCreateLoginLinkData
*/
public function testCreateLoginLink($user, array $extraProperties, Request $request = null)
Expand Down