Exemplo n.º 1
0
 /**
  * @covers ::processCckFieldValues
  */
 public function testProcessBooleanTextExplicitValues()
 {
     $info = array('widget_type' => 'optionwidgets_onoff', 'global_settings' => array('allowed_values' => "foo|Foo\nbaz|Baz"));
     $this->plugin->processCckFieldValues($this->migration, 'field', $info);
     $expected = ['value' => ['plugin' => 'static_map', 'source' => 'value', 'default_value' => 0, 'map' => ['baz' => 1]]];
     $this->assertSame($expected, $this->migration->getProcess()['process']);
 }
Exemplo n.º 2
0
 /**
  * @covers ::getFieldType
  * @dataProvider getFieldTypeProvider
  */
 public function testGetFieldType($expected_type, $widget_type, array $settings = array())
 {
     $row = new Row(array('widget_type' => $widget_type), array('widget_type' => array()));
     $row->setSourceProperty('global_settings', $settings);
     $this->assertSame($expected_type, $this->plugin->getFieldType($row));
 }