Пример #1
0
 public function Run()
 {
     $version = new VersionService();
     $platform = 'iPad';
     $currentVersion = '0.9';
     $result = $version->NeedUpdate($this->AddQuote($platform), $this->AddQuote($currentVersion));
     $this->AssertEquals($result->_returnCode, Constant\ErrorCode::VersionNeedUpdate, 'Need update');
     $platform = 'iPad';
     $currentVersion = '1.2';
     $result = $version->NeedUpdate($this->AddQuote($platform), $this->AddQuote($currentVersion));
     $this->AssertEquals($result->_returnCode, Constant\ErrorCode::OK, 'No Need update');
     $platform = 'abc';
     $result = $version->NeedUpdate($this->AddQuote($platform), $this->AddQuote($currentVersion));
     $this->AssertEquals($result->_returnCode, Constant\ErrorCode::VersionUnkownPlatform, 'Unkown platform');
 }
Пример #2
0
 /**
  * @param CacheStoreInterface $PrimaryCacheStore
  * @param VersionService $VersionService
  * @param string $nodeSchemaVersion
  * @param bool $nodeCacheKeepLocal
  */
 public function __construct(CacheStoreInterface $PrimaryCacheStore, VersionService $VersionService, $nodeSchemaVersion = null, $nodeCacheKeepLocal = true)
 {
     parent::__construct($PrimaryCacheStore, 'nc', $nodeCacheKeepLocal);
     $this->VersionService = $VersionService;
     $this->nodeSchemaVersion = $nodeSchemaVersion ?: $this->VersionService->getSystemVersion();
 }