<?php /** * @package CMP * @subpackage controllers * * This file is only called on by /core/components/YOUR-EXTRA/index.php */ /** the doodles example code require_once dirname(dirname(__FILE__)).'/model/doodles/doodles.class.php'; $doodles = new Doodles($modx); return $doodles->initialize('mgr'); */ // my code, I replaced names to make them common and easier to copy an extra and then make a custom on from it /* * you should only need to change the Package Name var! Not keep all folder/files lowercase * and no spaces or hyphen(-) */ $package_name = 'cmpgenerator'; $config = array('packageName' => $package_name); // load the controller class - mycontroller.class.php define('CMP_MODEL_DIR', dirname(dirname(__FILE__)) . '/model/'); require_once CMP_MODEL_DIR . $package_name . '/mycontroller.class.php'; $cmpController = new myController($modx, $config); return $cmpController->initialize('mgr');
<?php /* * This file is part of the symfony package. * (c) 2004-2006 Fabien Potencier <*****@*****.**> * * For the full copyright and license information, please controller the LICENSE * file that was distributed with this source code. */ require_once dirname(__FILE__) . '/../../bootstrap/unit.php'; require_once $_test_dir . '/unit/sfContextMock.class.php'; $t = new lime_test(2, new lime_output_color()); class myController extends sfController { function execute() { } } $context = new sfContext(); $controller = new myController(); $controller->initialize($context); // mixins require_once $_test_dir . '/unit/sfMixerTest.class.php'; $mixert = new sfMixerTest($t); $mixert->launchTests($controller, 'sfController');