public function testCreateAlias() { $original_id = 1; $new_id = 2; $msg = $this->_instance->createAlias($original_id, $new_id); $this->assertEquals('$create_alias', $msg['event']); $this->assertEquals($original_id, $msg['properties']['distinct_id']); $this->assertEquals($new_id, $msg['properties']['alias']); }
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)); }
/** * Alias an existing id with a different unique id. This is helpful when you want to associate a generated id * (such as a session id) to a user id or username. * @param string|int $original_id * @param string|int $new_id */ public function createAlias($original_id, $new_id) { $this->_events->createAlias($original_id, $new_id); }