public function testGenericGetters() { $type = $this->prophesize(TypeInterface::class)->reveal(); $metadata = new Field('fieldName', 'propertyName', $type, true, true); $this->assertSame('fieldName', $metadata->getFieldName()); $this->assertSame('propertyName', $metadata->getPropertyName()); $this->assertSame($type, $metadata->getType()); $this->assertTrue($metadata->isRepeatable()); $this->assertTrue($metadata->isReadOnly()); }
public static function fromInvalidField(Entity $entityMetadata, Field $fieldMetadata, Exception $previousException) : self { return new self(sprintf('Could not extract field "%s" from entity "%s", reason: %s', $fieldMetadata->getPropertyName(), $entityMetadata->getClassName(), $previousException->getMessage()), 0, $previousException); }