2017 © Pedro Peláez
 

standalone time-traveler

Travel the time in PHP

image

rezzza/time-traveler

Travel the time in PHP

  • Wednesday, August 13, 2014
  • by spy-seth
  • Repository
  • 7 Watchers
  • 103 Stars
  • 5,558 Installations
  • PHP
  • 0 Dependents
  • 1 Suggesters
  • 7 Forks
  • 4 Open issues
  • 2 Versions
  • 2 % Grown

The README.md

TimeTraveler

Latest Stable Version Build Status Scrutinizer Code Quality, (*1)

          _
         /-\
    _____|#|_____
   |_____________|
  |_______________|
|||_Time_Traveler_|||
 | |¯|¯|¯|||¯|¯|¯| |
 | |-|-|-|||-|-|-| |
 | |_|_|_|||_|_|_| |
 | ||~~~| | |¯¯¯|| |
 | ||~~~|!|!| O || |
 | ||~~~| |.|___|| |
 | ||¯¯¯| | |¯¯¯|| |
 | ||   | | |   || |
 | ||___| | |___|| |
 | ||¯¯¯| | |¯¯¯|| |
 | ||   | | |   || |
 | ||___| | |___|| |
|¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯|
 ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Mock the time system in PHP using AOP-PHP. You can now travel the time on your application easily !, (*2)

Methods supported

  • DateTime object.
  • date_create
  • date
  • gettimeofday
  • gmdate
  • microtime
  • strtotime
  • time

Usage

\Rezzza\TimeTraveler::enable();
\Rezzza\TimeTraveler::moveTo('2011-06-10 11:00:00');

var_dump(new \DateTime());           // 2011-06-10 11:00:00
var_dump(new \DateTime('+2 hours')); // 2011-06-10 13:00:00
var_dump(time());
var_dump(microtime());
var_dump(microtime(true));

\Rezzza\TimeTraveler::comeBack();

Launch tests

composer install --dev
bin/atoum

The Versions

13/08 2014

dev-master

9999999-dev https://github.com/rezzza/TimeTraveler

Travel the time in PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

mock time standalone

19/05 2014

v1.0.0

1.0.0.0 https://github.com/rezzza/TimeTraveler

Travel the time in PHP

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

mock time standalone