EcomDev_PHPUnit
EcomDev_PHPUnit copied to clipboard
Problems when trying to test adminhtml config
Hi! I'm trying to write some tests for a custom admin module and one of the things I need to check is the menu item existence, but it seems that my adminhtml.xml are not being loaded inside the test cases.
This is what I tried so far:
<?php
class MyModule_Adminsample_Test_Config_Global extends EcomDev_PHPUnit_Test_Case_Config
{
/* ... some tests ... */
public function testAdminMenuPosition()
{
$this->assertConfigNodeHasChild('adminhtml/menu/catalog/children', 'mymodule_adminsample_index');
}
/* ... some other tests ... */
}
The XML is okay (the menu item is showing on the page, under the catalog menu as expected), I var_dump'ed the config and noticed that everything I have in any adminhtml.xml is not being loaded.
I also tried to force loading them using the following, without success:
$this->app()->getConfig()->loadModulesConfiguration('adminhtml.xml', $this->app()->getConfig());
Am I missing something here or is it really a bug/limitation?
Thanks for the attention!
There is no way for now to test adminhtml.xml files.