Exemple #1
0
 public function testRenderTrack()
 {
     $renderer = new Renderer();
     $this->assertEquals('window.analytics.track("foo",[]);', $renderer->renderTrack('foo'));
     $this->assertEquals('window.analytics.track("foo",{"type":"bar"});', $renderer->renderTrack('foo', array('type' => 'bar')));
 }
Exemple #2
0
 /**
  * Renders the track method.
  *
  * @param string $event
  * @param array  $properties
  *
  * @return string
  */
 public function track($event, array $properties = array())
 {
     return $this->renderer->renderTrack($event, $properties);
 }