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'))); }
/** * 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); }