Пример #1
0
 public function donationRequested(DonationRequestedEvent $e)
 {
     $intent = $e->getIntent();
     $request = $this->container->get('request');
     $gac = $this->container->get('donate_core.analytics.cookieparser');
     $utm = $gac->parseCookies($request->cookies);
     if ($request->query->has($this->key)) {
         $intent->setCampaign($request->query->get($this->key));
     } else {
         $intent->setCampaign($utm->getCampaignName());
     }
     return $intent->getCampaign();
 }
 public function it_should_add_campaign_to_intent(DonationRequestedEvent $ev)
 {
     $intent = new Intent('100', 'phpspec');
     $ev->getIntent()->willReturn($intent);
     $this->donationRequested($ev)->shouldReturn('spec');
 }