示例#1
0
 /**
  * @dataProvider instanceProvider
  *
  * @since 1.0
  *
  * @param SomeProperty $description
  */
 public function testIsSubProperty(SomeProperty $description)
 {
     $isSubProperty = $description->isSubProperty();
     $this->assertInternalType('boolean', $isSubProperty);
     $newInstance = new SomeProperty($description->getPropertyId(), $description->getSubDescription(), $isSubProperty);
     $this->assertEquals($isSubProperty, $newInstance->isSubProperty(), 'Is sub property is returned as it was passed to the constructor');
 }
 private function buildQueryForSomeProperty(SomeProperty $someProperty, Expr $expr)
 {
     if ($someProperty->isSubProperty()) {
         throw new FeatureNotSupportedException('Sub-properties are not supported yet');
     }
     $propertyIdValue = $someProperty->getPropertyId();
     if (!$propertyIdValue instanceof EntityIdValue) {
         throw new FeatureNotSupportedException('PropertyId should be an EntityIdValue');
     }
     $propertyId = $propertyIdValue->getEntityId();
     if (!$propertyId instanceof PropertyId) {
         throw new FeatureNotSupportedException('PropertyId should be a PropertyId');
     }
     return $this->buildQueryForDescription($someProperty->getSubDescription(), $expr, $propertyId);
 }