public function testRenderMethod() { $method = $this->getMock('Helthe\\Component\\Segmentio\\Method\\MethodInterface'); $renderer = new Renderer(); $method->expects($this->once())->method('supports')->with($this->equalTo('browser'))->will($this->returnValue(true)); $method->expects($this->once())->method('getName')->will($this->returnValue('foo')); $method->expects($this->once())->method('getArguments')->will($this->returnValue(array('bar', null, array(), array('foo' => 'bar')))); $this->assertEquals('window.analytics.foo("bar",null,[],{"foo":"bar"});', $renderer->renderMethod($method)); }