Exemplo n.º 1
0
 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());
 }
Exemplo n.º 2
0
 /**
  * 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();
 }
Exemplo n.º 3
0
 /**
  * @return string
  */
 public function getVersion()
 {
     return $this->helper->getVersion();
 }