getByConfig() public method

get type by dynamic field config entity
public getByConfig ( ConfigEntity $config ) : AbstractType
$config Xpressengine\Config\ConfigEntity dynamic field config entity
return AbstractType
 /**
  * test get by config
  *
  * @return void
  */
 public function testGetByConfig()
 {
     $conn = $this->conn;
     $configHandler = $this->configHandler;
     $registerHandler = $this->registerHandler;
     $view = $this->view;
     $handler = new DynamicFieldHandler($conn, $configHandler, $registerHandler, $view);
     $config = $this->getConfigEntity();
     $config->shouldReceive('get')->with('typeId')->andReturn('type');
     $config->shouldReceive('get')->with('skinId')->andReturn('skin');
     $type = m::mock('Type', 'Xpressengine\\DynamicField\\AbstractType');
     $type->shouldReceive('setConfig');
     $type->shouldReceive('setSkin');
     $skin = m::mock('Skin', 'Xpressengine\\DynamicField\\AbstractSkin');
     $skin->shouldReceive('setConfig');
     $registerHandler->shouldReceive('getType')->andReturn($type);
     $registerHandler->shouldReceive('getSkin')->andReturn($skin);
     $result = $handler->getByConfig($config);
     $this->assertInstanceOf('Xpressengine\\DynamicField\\AbstractType', $result);
 }