コード例 #1
0
 public function testGetTypeNameWhenBlockTypeIsAddedAsObject()
 {
     $id = 'test_id';
     $name = 'test_name';
     $type = $this->getMock('Oro\\Component\\Layout\\BlockTypeInterface');
     $type->expects($this->once())->method('getName')->will($this->returnValue($name));
     $this->rawLayout->add($id, null, $type);
     $this->blockBuilder->initialize($id);
     $this->assertEquals($name, $this->blockBuilder->getTypeName());
 }
コード例 #2
0
ファイル: BlockTest.php プロジェクト: Maksold/platform
 public function testGetOptions()
 {
     $this->rawLayout->add('root', null, 'root', ['root_option1' => 'val1']);
     $this->rawLayout->setProperty('root', RawLayout::RESOLVED_OPTIONS, ['root_option1' => 'val1', 'id' => 'root']);
     $this->rawLayout->add('header', 'root', 'header', ['header_option1' => 'val1']);
     $this->rawLayout->setProperty('header', RawLayout::RESOLVED_OPTIONS, ['header_option1' => 'val1', 'id' => 'header']);
     $this->block->initialize('header');
     $this->assertEquals(['header_option1' => 'val1', 'id' => 'header'], $this->block->getOptions());
     $this->assertEquals(['root_option1' => 'val1', 'id' => 'root'], $this->block->getParent()->getOptions());
 }
コード例 #3
0
ファイル: RawLayoutTest.php プロジェクト: ramunasd/platform
 /**
  * @dataProvider             emptyStringDataProvider
  *
  * @expectedException \Oro\Component\Layout\Exception\InvalidArgumentException
  * @expectedExceptionMessage The item id must not be empty.
  */
 public function testGetHierarchyIteratorWithEmptyId($id)
 {
     $this->rawLayout->getHierarchyIterator($id);
 }
コード例 #4
0
 /**
  * {@inheritdoc}
  */
 public function removeOption($id, $optionName)
 {
     $options = $this->rawLayout->getProperty($id, RawLayout::OPTIONS);
     $this->propertyAccessor->remove($options, $this->getPropertyPath($optionName));
     $this->rawLayout->setProperty($id, RawLayout::OPTIONS, $options);
 }
コード例 #5
0
ファイル: BlockFactory.php プロジェクト: Maksold/platform
 /**
  * Checks whether the given block is a container for other blocks
  *
  * @param string $id
  *
  * @return bool
  */
 protected function isContainerBlock($id)
 {
     return $this->typeHelper->isInstanceOf($this->rawLayout->getProperty($id, RawLayout::BLOCK_TYPE, true), ContainerType::NAME);
 }