/** * @group fieldType * @group eztags * @covers \Netgen\TagsBundle\Core\Persistence\Legacy\Content\FieldValue\Converter\Tags::toStorageFieldDefinition */ public function testToStorageFieldDefinition() { $fieldTypeConstraints = new FieldTypeConstraints(); $fieldTypeConstraints->fieldSettings = new FieldSettings(array('subTreeLimit' => 0, 'showDropDown' => false, 'hideRootTag' => true, 'maxTags' => 10)); $storageFieldDefinition = new StorageFieldDefinition(); $this->converter->toStorageFieldDefinition(new PersistenceFieldDefinition(array('fieldTypeConstraints' => $fieldTypeConstraints)), $storageFieldDefinition); self::assertEquals(0, $storageFieldDefinition->dataInt1); self::assertEquals(false, $storageFieldDefinition->dataInt2); self::assertEquals(true, $storageFieldDefinition->dataInt3); self::assertEquals(10, $storageFieldDefinition->dataInt4); }
/** * @group fieldType * @group eztags * @covers \Netgen\TagsBundle\Core\Persistence\Legacy\Content\FieldValue\Converter\Tags::toStorageFieldDefinition */ public function testToStorageFieldDefinitionWithNoSettings() { $storageFieldDefinition = new StorageFieldDefinition(); $this->converter->toStorageFieldDefinition(new PersistenceFieldDefinition(), $storageFieldDefinition); self::assertEquals(0, $storageFieldDefinition->dataInt1); self::assertEquals(0, $storageFieldDefinition->dataInt2); self::assertEquals(0, $storageFieldDefinition->dataInt3); self::assertEquals(0, $storageFieldDefinition->dataInt4); }
/** * @group fieldType * @group eztags * @covers \Netgen\TagsBundle\Core\Persistence\Legacy\Content\FieldValue\Converter\Tags::toStorageFieldDefinition */ public function testToStorageFieldDefinitionWithNoSettings() { $storageFieldDefinition = new StorageFieldDefinition(); $this->converter->toStorageFieldDefinition(new PersistenceFieldDefinition(), $storageFieldDefinition); self::assertEquals(0, $storageFieldDefinition->dataInt1); self::assertEquals(0, $storageFieldDefinition->dataInt3); self::assertEquals(0, $storageFieldDefinition->dataInt4); self::assertEquals(Type::EDIT_VIEW_DEFAULT_VALUE, $storageFieldDefinition->dataText1); }