public function test_interval_after()
 {
     $post = new WP_Post((object) array('post_type' => Reminder\CPT::TYPE, 'ID' => 1));
     WP_Mock::wpFunction('get_post_meta', array('times' => 1, 'args' => array(1, '_itelic_renewal_reminder_days', true), 'return' => 5));
     WP_Mock::wpFunction('get_post_meta', array('times' => 1, 'args' => array(1, '_itelic_renewal_reminder_boa', true), 'return' => Reminder::TYPE_AFTER));
     $reminder = new Reminder($post);
     $expects = new DateInterval('P5D');
     $expects->invert = true;
     $this->assertEquals($expects, $reminder->get_interval());
 }
 /**
  * Make the notification object.
  *
  * @since 1.0
  *
  * @param Reminder         $reminder
  * @param Key              $key
  * @param Template_Manager $manager
  *
  * @return Notification
  */
 protected function make_notification(Reminder $reminder, Key $key, Template_Manager $manager)
 {
     $template = $reminder->get_post();
     $notification = new Notification($key->get_customer()->wp_user, $manager, $template->post_content, $template->post_title);
     $transaction = $key->get_transaction();
     if (!empty($transaction->cart_details->is_guest_checkout)) {
         if (function_exists('it_exchange_guest_checkout_generate_guest_user_object')) {
             $notification = new Guest_Notification($notification, $transaction);
         } else {
             return null;
         }
     }
     $notification->add_data_source($key);
     $notification->add_data_source(new Discount($key));
     return $notification;
 }