public function testGetPortWithUrl() { $port = 10000; $url = $this->getMock('Versionable\\Prospect\\Url\\UrlInterface', array(), array('http://testing.com')); $url->expects($this->any())->method('getPort')->will($this->returnValue($port)); $this->object->setUrl($url); $this->assertEquals($port, $this->object->getPort()); }