/**
  * DataProvider for all properties with a valid value and an invalid value
  *
  * @return array
  */
 public function propertiesOfSutDataProvider()
 {
     return array(array('propertyName' => 'id', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'name', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'description', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'rootFolderId', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'principalIdAnonymous', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'principalIdAnyone', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'thinClientUri', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'latestChangeLogToken', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'vendorName', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'productName', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'productVersion', 'validValue' => 'exampleString', 'invalidValue' => 123), array('propertyName' => 'changesIncomplete', 'validValue' => true, 'invalidValue' => 1), array('propertyName' => 'capabilities', 'validValue' => $this->getMockForAbstractClass('\\Dkd\\PhpCmis\\Data\\RepositoryCapabilitiesInterface'), 'invalidValue' => self::DO_NOT_TEST_INVALID_TYPE_VALUE), array('propertyName' => 'aclCapabilities', 'validValue' => $this->getMockForAbstractClass('\\Dkd\\PhpCmis\\Data\\AclCapabilitiesInterface'), 'invalidValue' => self::DO_NOT_TEST_INVALID_TYPE_VALUE), array('propertyName' => 'cmisVersion', 'validValue' => CmisVersion::cast(CmisVersion::CMIS_1_1), 'invalidValue' => self::DO_NOT_TEST_INVALID_TYPE_VALUE), array('propertyName' => 'changesOnType', 'validValue' => array(BaseTypeId::cast(BaseTypeId::CMIS_DOCUMENT)), 'invalidValue' => array('foo')), array('propertyName' => 'extensionFeatures', 'validValue' => array($this->getMockForAbstractClass('\\Dkd\\PhpCmis\\Data\\ExtensionFeatureInterface')), 'invalidValue' => array(new \stdClass())));
 }
 /**
  * @param RepositoryCapabilities $repositoryCapabilities
  * @param AclCapabilities $aclCapabilities
  * @return RepositoryInfoBrowserBinding
  */
 protected function getExpectedRepositoryInfoObjectForFullRequest($repositoryCapabilities, $aclCapabilities)
 {
     $repositoryInfo = new RepositoryInfoBrowserBinding();
     $repositoryInfo->setId('A1');
     $repositoryInfo->setName('Apache Chemistry OpenCMIS InMemory Repository');
     $repositoryInfo->setCmisVersion(CmisVersion::cast(CmisVersion::CMIS_1_1));
     $repositoryInfo->setDescription('Apache Chemistry OpenCMIS InMemory Repository (Version: ?)');
     $repositoryInfo->setVendorName('Apache Chemistry');
     $repositoryInfo->setProductName('OpenCMIS InMemory-Server');
     $repositoryInfo->setProductVersion('?');
     $repositoryInfo->setRootFolderId('100');
     $repositoryInfo->setRepositoryUrl('http://www.example.com:8080/inmemory/browser/A1');
     $repositoryInfo->setCapabilities($repositoryCapabilities);
     $repositoryInfo->setRootUrl('http://www.example.com:8080/inmemory/browser/A1/root');
     $repositoryInfo->setAclCapabilities($aclCapabilities);
     $repositoryInfo->setLatestChangeLogToken('0');
     $repositoryInfo->setCmisVersion(CmisVersion::cast('1.1'));
     $repositoryInfo->setChangesIncomplete(true);
     $repositoryInfo->setChangesOnType(array(BaseTypeId::cast(BaseTypeId::CMIS_DOCUMENT)));
     $repositoryInfo->setPrincipalIdAnonymous('anonymous');
     $repositoryInfo->setPrincipalIdAnyone('anyone');
     $repositoryInfo->setExtensions($this->cmisExtensionsDummy);
     $extensionFeature = new ExtensionFeature();
     $extensionFeature->setId('E1');
     $extensionFeature->setUrl('http://foo.bar.baz');
     $extensionFeature->setCommonName('commonName');
     $extensionFeature->setVersionLabel('versionLabel');
     $extensionFeature->setDescription('Description');
     $extensionFeature->setFeatureData(array('foo' => 'bar'));
     $extensionFeature->setExtensions($this->cmisExtensionsDummy);
     $repositoryInfo->setExtensionFeatures(array($extensionFeature));
     return $repositoryInfo;
 }
Beispiel #3
0
 /**
  * Deletes a type.
  *
  * @param string $typeId the ID of the type to delete
  * @throws CmisNotSupportedException If repository version 1.0
  */
 public function deleteType($typeId)
 {
     if ($this->getRepositoryInfo()->getCmisVersion() == CmisVersion::cast(CmisVersion::CMIS_1_0)) {
         throw new CmisNotSupportedException('This method is not supported for CMIS 1.0 repositories.');
     }
     $this->getBinding()->getRepositoryService()->deleteType($this->getRepositoryId(), $typeId);
     $this->removeObjectFromCache($this->createObjectId($typeId));
 }
 /**
  * @param RepositoryInfoBrowserBinding $object
  * @param array $data
  * @return RepositoryInfoBrowserBinding
  */
 protected function setRepositoryInfoValues(RepositoryInfoBrowserBinding $object, $data)
 {
     if (isset($data[JSONConstants::JSON_REPINFO_CAPABILITIES]) && is_array($data[JSONConstants::JSON_REPINFO_CAPABILITIES])) {
         $repositoryCapabilities = $this->convertRepositoryCapabilities($data[JSONConstants::JSON_REPINFO_CAPABILITIES]);
         if ($repositoryCapabilities !== null) {
             $data[JSONConstants::JSON_REPINFO_CAPABILITIES] = $repositoryCapabilities;
         } else {
             unset($data[JSONConstants::JSON_REPINFO_CAPABILITIES]);
         }
     }
     if (isset($data[JSONConstants::JSON_REPINFO_ACL_CAPABILITIES]) && is_array($data[JSONConstants::JSON_REPINFO_ACL_CAPABILITIES])) {
         $aclCapabilities = $this->convertAclCapabilities($data[JSONConstants::JSON_REPINFO_ACL_CAPABILITIES]);
         if ($aclCapabilities !== null) {
             $data[JSONConstants::JSON_REPINFO_ACL_CAPABILITIES] = $aclCapabilities;
         } else {
             unset($data[JSONConstants::JSON_REPINFO_ACL_CAPABILITIES]);
         }
     }
     if (isset($data[JSONConstants::JSON_REPINFO_CHANGES_ON_TYPE]) && is_array($data[JSONConstants::JSON_REPINFO_CHANGES_ON_TYPE])) {
         $types = array();
         foreach ($data[JSONConstants::JSON_REPINFO_CHANGES_ON_TYPE] as $type) {
             if (!empty($type)) {
                 $types[] = BaseTypeId::cast($type);
             }
         }
         $data[JSONConstants::JSON_REPINFO_CHANGES_ON_TYPE] = $types;
     }
     if (isset($data[JSONConstants::JSON_REPINFO_EXTENDED_FEATURES]) && is_array($data[JSONConstants::JSON_REPINFO_EXTENDED_FEATURES])) {
         $data[JSONConstants::JSON_REPINFO_EXTENDED_FEATURES] = $this->convertExtensionFeatures($data[JSONConstants::JSON_REPINFO_EXTENDED_FEATURES]);
     }
     if (isset($data[JSONConstants::JSON_REPINFO_CMIS_VERSION_SUPPORTED])) {
         $data[JSONConstants::JSON_REPINFO_CMIS_VERSION_SUPPORTED] = CmisVersion::cast($data[JSONConstants::JSON_REPINFO_CMIS_VERSION_SUPPORTED]);
     }
     $object->setExtensions($this->convertExtension($data, JSONConstants::getRepositoryInfoKeys()));
     $object->populate($data, array_merge(array_combine(JSONConstants::getRepositoryInfoKeys(), JSONConstants::getRepositoryInfoKeys()), array(JSONConstants::JSON_REPINFO_DESCRIPTION => 'description', JSONConstants::JSON_REPINFO_CMIS_VERSION_SUPPORTED => 'cmisVersion', JSONConstants::JSON_REPINFO_ID => 'id', JSONConstants::JSON_REPINFO_ROOT_FOLDER_URL => 'rootUrl', JSONConstants::JSON_REPINFO_NAME => 'name', JSONConstants::JSON_REPINFO_EXTENDED_FEATURES => 'extensionFeatures')), true);
     return $object;
 }
 /**
  * Set the supported CMIS version
  *
  * @param CmisVersion|null $cmisVersion
  */
 public function setCmisVersion(CmisVersion $cmisVersion = null)
 {
     $this->cmisVersion = CmisVersion::cast($cmisVersion);
 }