Skip to content

Commit

Permalink
adding tests for config events
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Sep 29, 2012
1 parent a506197 commit 8f97d06
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 62 deletions.
90 changes: 52 additions & 38 deletions Core/Configs/Lib/ConfigsEvents.php
@@ -1,43 +1,57 @@
<?php
/**
* @brief ConfigsEvents for the Configs plugin to attach into the application
*
* @copyright Copyright (c) 2010 Carl Sutton ( dogmatic69 )
* @link http://www.infinitas-cms.org
* @package Infinitas.Configs
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.8a
*
* @author dogmatic69
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*/
/**
* @brief ConfigsEvents for the Configs plugin to attach into the application
*
* @copyright Copyright (c) 2010 Carl Sutton ( dogmatic69 )
* @link http://www.infinitas-cms.org
* @package Infinitas.Configs
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.8a
*
* @author dogmatic69
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*/

final class ConfigsEvents extends AppEvents {
class ConfigsEvents extends AppEvents {
/**
* @brief get the cache config for this plugin
*
* @return array
*/
public function onSetupCache() {
return array(
'name' => 'configs',
'config' => array(
'prefix' => 'core.configs.',
)
);
}

public function onSetupCache() {
return array(
'name' => 'configs',
'config' => array(
'prefix' => 'core.configs.',
)
);
}
/**
* @brief get the admin menu
*
* @return array
*/
public function onAdminMenu($event) {
$menu['main'] = array(
'Dashboard' => array('plugin' => 'management', 'controller' => 'management', 'action' => 'site'),
'Configuration' => array('plugin' => 'configs', 'controller' => 'configs', 'action' => 'index'),
'Available' => array('plugin' => 'configs', 'controller' => 'configs', 'action' => 'available')
);

public function onAdminMenu($event) {
$menu['main'] = array(
'Dashboard' => array('plugin' => 'management', 'controller' => 'management', 'action' => 'site'),
'Configuration' => array('plugin' => 'configs', 'controller' => 'configs', 'action' => 'index'),
'Available' => array('plugin' => 'configs', 'controller' => 'configs', 'action' => 'available')
);
return $menu;
}

return $menu;
}

public function onGetRequiredFixtures($event) {
return array(
'Configs.Config',
);
}
}
/**
* @brief get required fixtures
*
* @return array
*/
public function onGetRequiredFixtures($event) {
return array(
'Configs.Config',
);
}
}
34 changes: 10 additions & 24 deletions Core/Configs/Test/Case/Lib/ConfigsEventsTest.php
@@ -1,25 +1,11 @@
<?php
class ConfigsEventsTest extends CakeTestCase {
var $fixturesasd = array(
'plugin.configs.config',
'plugin.themes.theme',
'plugin.routes.route',
'plugin.view_counter.view_counter_view',

'plugin.categories.category',
'plugin.users.group',
);

public function startTest() {
$this->Event = EventCore::getInstance();
}

public function endTest() {
unset($this->Event);
ClassRegistry::flush();
}

public function testGenerateSiteMapData() {
$this->assertInstanceOf('EventCore', $this->Event);
}
}
/**
* @brief ConfigsEventsTest
*
* These tests are extended from InfinitasEventTestCase which does most of the
* automated testing for simple events
*/
App::uses('InfinitasEventTestCase', 'Events.Test/Lib');
class ConfigsEventsTest extends InfinitasEventTestCase {

}

0 comments on commit 8f97d06

Please sign in to comment.