Пример #1
0
 /**
  * Gets the configuration options for this Widget.
  * @return array of options. Each option has the following keys:
  * * name: The code name of the option.
  * * types: Array of accepted types.
  * * description: The description in the code.
  */
 public function getOptions(WidgetInfo $info)
 {
     $options = $this->getOptionsFromClass($info->getReflection());
     foreach ($info->getMixins() as $mixin) {
         $mixinClass = new ReflectionClass($mixin);
         $options = array_merge($this->getOptionsFromClass($mixinClass), $options);
     }
     return $options;
 }
Пример #2
0
 /**
  * @dataProvider provideGetMixins
  */
 public function testGetMixins($class, array $expectedMixins)
 {
     $widgetInfo = new WidgetInfo('test', $class);
     $this->assertEquals($widgetInfo->getMixins(), $expectedMixins);
 }