public function ConfigurationHandlerMenuLinksTestCase::testExportToDataStore in Configuration Management 7.2
File
- tests/
handlers/ menu_links.test, line 72 - Tests for Configuration Management: Content Types.
Class
- ConfigurationHandlerMenuLinksTestCase
- Base class for functional tests for configuration management.
Code
public function testExportToDataStore() {
$menu_link = array(
'link_path' => 'admin',
'link_title' => 'My link',
'menu_name' => 'management',
'weight' => 0,
'expanded' => 0,
'options' => array(),
'router_path' => 'admin',
);
$saved = menu_link_save($menu_link);
$this
->assertTrue($saved, "The menu link was saved in the ActiveStore.");
$config = 'menu_link.' . sha1(str_replace('-', '_', $menu_link['menu_name']) . ':' . $menu_link['link_path']);
$results = ConfigurationManagement::exportToDataStore(array(
$config,
), FALSE, FALSE);
$exported = $results
->getInfo('exported');
$this
->assertTrue(in_array($config, $exported), "Configuration for {$config} was exported.");
$file_for_config = $this->datastore_path . '/' . $config . '.inc';
$this
->assertTrue(file_exists($file_for_config), "The file that storages the menu was created.");
}