Why am I getting call to undefined function after splitting module functions to two files? Now my module has two main files:


menu_perm.module 
menu_perm.admin.inc


I added second file to .info:


  files[] = menu_perm.admin.inc


I cleared the cache.

In my test class (PHPUnit) file I am bootrapping Drupal by:

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);


and I call form submit function manually inside test function, ends with below error:


  Call to undefined function menu_perm_user_form_submit()


Function is in menu_perm.admin.inc.

Before this everything was ok.

What am I doing wrong here?
files[] only works for class/interface autoloading, it won't include arbitrary PHP files. The docs say


  Drupal now supports a dynamic-loading code registry. To support it, all modules must now declare any code files containing class or interface declarations in the .info file


You can get around it by adding a line like this to the top of your .module file:

require_once DRUPAL_ROOT . '/sites/all/modules/my_module/my_module.admin.inc';