I would like to set cron function in my custom module. I have created one form which is called with submit button from UI. Now I would like to submit/call that form from another page (.module file) where I have written my hook_cron function, how it would be possible?
In Drupal 7, I use
$form_state['values'] = ""; drupal_form_submit('customfeedimport_main_pagecallback_submit', $form_state);
But I am new to Drupal 8, so how to perform this cron thing in Drupal 8?
Also what should be included in the namespace, use?