public function testRenderPage() { $renderer = new Renderer(); $this->assertEquals('window.analytics.page(null,null,[]);', $renderer->renderPage()); $this->assertEquals('window.analytics.page(null,"foo",[]);', $renderer->renderPage('foo')); $this->assertEquals('window.analytics.page("bar","foo",[]);', $renderer->renderPage('foo', 'bar')); $this->assertEquals('window.analytics.page("bar","foo",{"url":"http:\\/\\/foo.bar"});', $renderer->renderPage('foo', 'bar', array('url' => 'http://foo.bar'))); }
/** * Renders the page method. * * @param string $name * @param string $category * @param array $properties * * @return string */ public function page($name = null, $category = null, array $properties = array()) { return $this->renderer->renderPage($name, $category, $properties); }