public function testGetVersionCached() { $cache = $this->getMockBuilder('Doctrine\\Common\\Cache\\CacheProvider')->disableOriginalConstructor()->setMethods(array('save', 'contains', 'fetch'))->getMockForAbstractClass(); $cache->expects($this->once())->method('contains')->with(OroPlatformBundle::PACKAGE_NAME)->will($this->returnValue(true)); $cache->expects($this->once())->method('fetch')->with(OroPlatformBundle::PACKAGE_NAME)->will($this->returnValue('1.1')); $cache->expects($this->never())->method('save'); $this->helper->setCache($cache); $this->assertEquals('1.1', $this->helper->getVersion()); }
/** * Append Platform version to URL * * @param string $url * @return string */ protected function appendVersion($url) { if (strpos($url, "?")) { $url .= "&"; } else { $url .= "?"; } return $url . "v=" . $this->helper->getVersion(); }
/** * @return string */ public function getVersion() { return $this->helper->getVersion(); }