public function testTrack() { $this->_instance->track("test_event", array("number" => 1)); $queue = $this->_instance->getQueue(); $this->assertEquals(1, count($queue)); $this->assertEquals("test_event", $queue[0]['event']); $this->assertEquals(1, $queue[0]['properties']['number']); }
public function testSetMaxQueueSize() { $this->_instance->enqueue(array("event" => "test")); $queue = $this->_instance->getQueue(); $this->assertEquals(1, count($queue)); $this->_instance->flush(); $new_instance = new Producers_MixpanelEvents("token", array('max_queue_size' => 0)); $new_instance->track("test"); $queue = $new_instance->getQueue(); $this->assertEquals(0, count($queue)); }
/** * Track an event defined by $event associated with metadata defined by $properties * @param string $event * @param array $properties */ public function track($event, $properties = array()) { $this->_events->track($event, $properties); }