Exemplo n.º 1
0
 public function testConstructor()
 {
     $this->assertEquals($this->category, $this->event->getCategory());
     $this->assertEquals($this->action, $this->event->getAction());
     $this->assertNull($this->event->getLabel());
     $this->assertNull($this->event->getValue());
     $label = 'Test label';
     $value = 'Test value';
     $event = new Event($this->category, $this->action, $label, $value);
     $this->assertEquals($label, $event->getLabel());
     $this->assertEquals($value, $event->getValue());
 }
Exemplo n.º 2
0
 /**
  * @param array[] AntiMattr\GoogleBundle\Analytics\Event $eventQueue
  */
 public function getEventQueue()
 {
     $eventArray = $this->getOnce(self::EVENT_QUEUE_KEY);
     $hydratedEvents = array();
     foreach ($eventArray as $value) {
         if (is_object($value)) {
             $hydratedEvents[] = $value;
             continue;
         }
         $event = new Event();
         $event->fromArray($value);
         $hydratedEvents[] = $event;
     }
     return $hydratedEvents;
 }