$decimal->setPropertyType(\Dkd\PhpCmis\Enum\PropertyType::cast(\Dkd\PhpCmis\Enum\PropertyType::DECIMAL));
$decimal->setLocalName('cmis:decimalValue');
$decimal->setQueryName('cmis:decimalValue');
$decimal->setIsInherited(true);
$decimal->setIsOpenChoice(true);
$decimal->setIsOrderable(false);
$decimal->setDescription('This is a decimal property.');
$decimal->setUpdatability(\Dkd\PhpCmis\Enum\Updatability::cast(\Dkd\PhpCmis\Enum\Updatability::READWRITE));
$decimal->setLocalNamespace('namespace');
$decimal->setDisplayName('Decimal property');
$decimal->setIsRequired(false);
$decimal->setCardinality(\Dkd\PhpCmis\Enum\Cardinality::cast(\Dkd\PhpCmis\Enum\Cardinality::MULTI));
$decimal->setIsQueryable(true);
$decimal->setMinValue(5);
$decimal->setMaxValue(15);
$decimal->setPrecision(\Dkd\PhpCmis\Enum\DecimalPrecision::cast(\Dkd\PhpCmis\Enum\DecimalPrecision::BITS64));
$html = new \Dkd\PhpCmis\DataObjects\PropertyHtmlDefinition('cmis:html');
$html->setPropertyType(\Dkd\PhpCmis\Enum\PropertyType::cast(\Dkd\PhpCmis\Enum\PropertyType::HTML));
$html->setLocalName('cmis:htmlValue');
$html->setQueryName('cmis:htmlValue');
$html->setIsInherited(true);
$html->setIsOpenChoice(true);
$html->setIsOrderable(false);
$html->setDescription('This is a html property.');
$html->setUpdatability(\Dkd\PhpCmis\Enum\Updatability::cast(\Dkd\PhpCmis\Enum\Updatability::READWRITE));
$html->setLocalNamespace('namespace');
$html->setDisplayName('Html property');
$html->setIsRequired(false);
$html->setCardinality(\Dkd\PhpCmis\Enum\Cardinality::cast(\Dkd\PhpCmis\Enum\Cardinality::MULTI));
$html->setIsQueryable(true);
$integer = new \Dkd\PhpCmis\DataObjects\PropertyIntegerDefinition('cmis:integer');
 /**
  * Cast data values to the expected type
  *
  * @param array $data
  * @return array
  */
 protected function preparePropertyDefinitionData(array $data)
 {
     $data[JSONConstants::JSON_PROPERTY_TYPE_PROPERTY_TYPE] = PropertyType::cast($data[JSONConstants::JSON_PROPERTY_TYPE_PROPERTY_TYPE]);
     if (isset($data[JSONConstants::JSON_PROPERTY_TYPE_DEAULT_VALUE])) {
         $data[JSONConstants::JSON_PROPERTY_TYPE_DEAULT_VALUE] = (array) $data[JSONConstants::JSON_PROPERTY_TYPE_DEAULT_VALUE];
     }
     if (isset($data[JSONConstants::JSON_PROPERTY_TYPE_RESOLUTION])) {
         $data[JSONConstants::JSON_PROPERTY_TYPE_RESOLUTION] = DateTimeResolution::cast($data[JSONConstants::JSON_PROPERTY_TYPE_RESOLUTION]);
     }
     if (isset($data[JSONConstants::JSON_PROPERTY_TYPE_PRECISION])) {
         $data[JSONConstants::JSON_PROPERTY_TYPE_PRECISION] = DecimalPrecision::cast($data[JSONConstants::JSON_PROPERTY_TYPE_PRECISION]);
     }
     if (isset($data[JSONConstants::JSON_PROPERTY_TYPE_CARDINALITY])) {
         $data[JSONConstants::JSON_PROPERTY_TYPE_CARDINALITY] = Cardinality::cast($data[JSONConstants::JSON_PROPERTY_TYPE_CARDINALITY]);
     }
     if (isset($data[JSONConstants::JSON_PROPERTY_TYPE_UPDATABILITY])) {
         $data[JSONConstants::JSON_PROPERTY_TYPE_UPDATABILITY] = Updatability::cast($data[JSONConstants::JSON_PROPERTY_TYPE_UPDATABILITY]);
     }
     return $data;
 }
 public function testPreparePropertyDefinitionDataConvertsValuesToExpectedValues()
 {
     $input = array(JSONConstants::JSON_PROPERTY_TYPE_PROPERTY_TYPE => 'boolean', JSONConstants::JSON_PROPERTY_TYPE_DEAULT_VALUE => true, JSONConstants::JSON_PROPERTY_TYPE_RESOLUTION => 'date', JSONConstants::JSON_PROPERTY_TYPE_PRECISION => '32', JSONConstants::JSON_PROPERTY_TYPE_CARDINALITY => 'single', JSONConstants::JSON_PROPERTY_TYPE_UPDATABILITY => 'readonly');
     $expected = array(JSONConstants::JSON_PROPERTY_TYPE_PROPERTY_TYPE => PropertyType::cast('boolean'), JSONConstants::JSON_PROPERTY_TYPE_DEAULT_VALUE => array(true), JSONConstants::JSON_PROPERTY_TYPE_RESOLUTION => DateTimeResolution::cast('date'), JSONConstants::JSON_PROPERTY_TYPE_PRECISION => DecimalPrecision::cast('32'), JSONConstants::JSON_PROPERTY_TYPE_CARDINALITY => Cardinality::cast('single'), JSONConstants::JSON_PROPERTY_TYPE_UPDATABILITY => Updatability::cast('readonly'));
     $this->assertEquals($expected, $this->getMethod(self::CLASS_TO_TEST, 'preparePropertyDefinitionData')->invokeArgs($this->jsonConverter, array($input)));
 }
 /**
  * @depends testSetPrecisionSetsProperty
  */
 public function testGetPrecisionReturnsPropertyValue()
 {
     $precision = DecimalPrecision::cast(DecimalPrecision::BITS32);
     $this->propertyDecimalDefinition->setPrecision($precision);
     $this->assertSame($precision, $this->propertyDecimalDefinition->getPrecision());
 }