public function onSuccess(SubscriptionEvent $event)
 {
     $subscription = $event->getSubscription();
     if (!$subscription instanceof RecurringSubscriptionInterface) {
         throw new \InvalidArgumentException('Subscription must implement RecurringSubscriptionInterface');
     }
     $this->scheduler->schedule($subscription, $subscription);
 }
 public function it_decrements_max_cycles(RecurringSubscriptionInterface $subscription, SubscriptionEvent $event, RecurringSchedulerInterface $scheduler)
 {
     $event->getSubscription()->willReturn($subscription);
     $scheduler->schedule($subscription, $subscription)->shouldBeCalled();
     $this->onSuccess($event);
 }