I am testing the recurring framework in Drupal commerce on my local mamp environment and I want to test the recurring payments. How to I trick my Drupal site into thinking it's a day later so it will trigger the recurring payment?
If you are working with 5.3+ you can do a trick with namespaces: implementing a new time() function inside your current namespace and create a shared resource where you set the return value in your tests.
You can found a complete description in this blog post:
Using PHP timezone function change the timezone first. See the links for more detail about timezone.
Calculate day later time using
date_default_timezone_set('America/Los_Angeles'); $new_date = date('Y-m-d H:i:s', strtotime('+1 day', $current_date);
similar functions. which will help you to test the recurring system by setting manual time to drupal.
Drupal provide default time zone functions just so you can setting timezone and calculate the time in your hook_cron(). while trigger will get fired Cron processing will work based on your condition.
Hope it will help.