Ejemplo n.º 1
0
 public function testRaiseVersion()
 {
     $version = new Version(2, 0);
     $version->raiseVersion(1, 5);
     $this->assertEquals(2, $version->getMajor());
     $this->assertEquals(0, $version->getMinor());
     $version->raiseVersion(3, 0);
     $this->assertEquals(3, $version->getMajor());
     $this->assertEquals(0, $version->getMinor());
     $version->raiseVersion(3, 1);
     $this->assertEquals(3, $version->getMajor());
     $this->assertEquals(1, $version->getMinor());
 }
Ejemplo n.º 2
0
 /**
  * Get appropriate data service and edm schema version
  * 
  * @param Version &$dsVersion        On return, this parmater will contain 
  *                                   data service version for the metadata
  * @param string  &$edmSchemaVersion On return, this parmater will contain 
  *                                   edm schema version for the metadata
  * 
  * @return void 
  */
 public function getDataServiceAndEdmSchemaVersions(Version &$dsVersion, &$edmSchemaVersion)
 {
     if ($this->_metadataResourceTypeSet->hasNamedStreams()) {
         $dsVersion->raiseVersion(3, 0);
         if ($edmSchemaVersion < EdmSchemaVersion::VERSION_2_DOT_0) {
             $edmSchemaVersion = EdmSchemaVersion::VERSION_2_DOT_0;
         }
     }
     if ($this->_metadataResourceTypeSet->hasBagProperty()) {
         $dsVersion->raiseVersion(3, 0);
         if ($edmSchemaVersion < EdmSchemaVersion::VERSION_2_DOT_2) {
             $edmSchemaVersion = EdmSchemaVersion::VERSION_2_DOT_2;
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * Raise the response version for this request and perform capability negotiation.
  *
  * 
  * @param int $major The major segment of the version
  * @param int $minor The minor segment of the version
  * 
  * @throws ODataException If capability negotiation fails.
  */
 public function raiseResponseVersion($major, $minor)
 {
     if ($this->requiredMinResponseVersion->raiseVersion($major, $minor)) {
         $this->validateVersions();
     }
 }