public function testConvertPolicyIdsConvertsArrayToPolicyIdsListObject()
 {
     $expectedPolicyIdsList = new PolicyIdList();
     $expectedPolicyIdsList->setPolicyIds(array('id1', 'id2'));
     $expectedPolicyIdsList->setExtensions($this->cmisExtensionsDummy);
     $getObjectResponse = $this->getResponseFixtureContentAsArray('Cmis/v1.1/BrowserBinding/getObject-response.log');
     $result = $this->jsonConverter->convertPolicyIdList($getObjectResponse[JSONConstants::JSON_OBJECT_POLICY_IDS]);
     $this->assertEquals($expectedPolicyIdsList, $result);
     return $result;
 }
 /**
  * @depends testSetPolicyIdsSetsProperty
  */
 public function testGetPolicyIdsReturnsPropertyValue()
 {
     $policyIdsList = array('foo', 'bar');
     $this->policyIdList->setPolicyIds($policyIdsList);
     $this->assertSame($policyIdsList, $this->policyIdList->getPolicyIds());
 }
Ejemplo n.º 3
0
 /**
  * Converts a list of policy ids.
  *
  * @param array|null $data
  * @return PolicyIdList List of policy ids
  */
 public function convertPolicyIdList(array $data = null)
 {
     $policyIdsList = new PolicyIdList();
     $list = array();
     if (isset($data[JSONConstants::JSON_OBJECT_POLICY_IDS_IDS])) {
         foreach ((array) $data[JSONConstants::JSON_OBJECT_POLICY_IDS_IDS] as $id) {
             if (!empty($id) && is_string($id)) {
                 $list[] = $id;
             }
         }
     }
     $policyIdsList->setPolicyIds($list);
     $policyIdsList->setExtensions($this->convertExtension($data, JSONConstants::getPolicyIdsKeys()));
     return $policyIdsList;
 }