thephpleague / oauth2-client

Easy integration with OAuth 2.0 service providers.
http://oauth2-client.thephpleague.com
MIT License
3.66k stars 752 forks source link

hasExpired() should use self::getTimeNow() #993

Open prikkprikkprikk opened 1 year ago

prikkprikkprikk commented 1 year ago

While trying to test some code that caches an AccessToken and refreshes it if it has expired, I discovered that AccessToken->hasExpired() uses time() instead of self::getTimeNow(), and thus ignores self::$timeNow when testing.

This pull request fixes that.

codecov[bot] commented 1 year ago

Codecov Report

Merging #993 (4884dea) into master (164ccb0) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##              master      #993   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
  Complexity       190       190           
===========================================
  Files             20        20           
  Lines            514       514           
===========================================
  Hits             514       514           
Impacted Files Coverage Δ
src/Token/AccessToken.php 100.00% <100.00%> (ø)