Sulu\Component\Content\Metadata\PropertyMetadata::getColSpan PHP Method

getColSpan() public method

public getColSpan ( )
    public function getColSpan()
    {
        return $this->colSpan;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * It should create standard properties from "new" properties.
  */
 public function testCreateProperty()
 {
     $name = 'foo';
     $title = ['de' => 'Tite'];
     $description = ['de' => 'Description'];
     $placeholder = ['de' => 'Placehodler'];
     $type = 'type';
     $required = true;
     $localized = true;
     $maxOccurs = 1;
     $minOccurs = 1;
     $parameters = [['name' => 'prop', 'type' => 'type', 'value' => 'value', 'meta' => []], ['name' => 'propfoo', 'type' => 'type', 'value' => 'value', 'meta' => []]];
     $colSpan = 6;
     $this->property1->getType()->willReturn($type);
     $this->property1->getName()->willReturn($name);
     $this->property1->isRequired()->willReturn($required);
     $this->property1->isLocalized()->willReturn($required);
     $this->property1->getMaxOccurs()->willReturn($maxOccurs);
     $this->property1->getMinOccurs()->willReturn($minOccurs);
     $this->property1->getColSpan()->willReturn($colSpan);
     $this->property1->getParameters()->willReturn($parameters);
     $this->property1->title = $title;
     $this->property1->description = $description;
     $this->property1->placeholder = $placeholder;
     $legacyProperty = $this->factory->createProperty($this->property1->reveal());
     $this->assertInstanceOf(LegacyPropertyInterface::class, $legacyProperty);
     $this->assertEquals($legacyProperty->getContentTypeName(), $type);
     $this->assertEquals($legacyProperty->getName(), $name);
     $this->assertEquals($legacyProperty->getMandatory(), $required);
     $this->assertEquals($legacyProperty->getMultilingual(), $localized);
     $this->assertEquals($legacyProperty->getMaxOccurs(), $maxOccurs);
     $this->assertEquals($legacyProperty->getMinOccurs(), $minOccurs);
     $this->assertEquals($legacyProperty->getColspan(), $colSpan);
     $this->assertContainsOnlyInstancesOf(PropertyParameter::class, $legacyProperty->getParams());
     $this->assertArrayHasKey('prop', $legacyProperty->getParams());
     $this->assertArrayHasKey('propfoo', $legacyProperty->getParams());
     $this->assertEquals($title['de'], $legacyProperty->getTitle('de'));
     $this->assertEquals($description['de'], $legacyProperty->getInfoText('de'));
     $this->assertEquals($placeholder['de'], $legacyProperty->getPlaceholder('de'));
     return $this->property1;
 }