<?php define('TEST_APP_INSTANCE', true); // change the following paths if necessary $yiit = dirname(__FILE__) . '/../../../common/lib/vendor/yiisoft/yii/framework/yiit.php'; require_once $yiit; require_once dirname(__FILE__) . '/WebTestCase.php'; require './../../../common/lib/vendor/autoload.php'; \Yii::createWebApplication(Yiinitializr\Helpers\Initializer::config('frontend', array(__DIR__ . '/../../../common/config/main.php', __DIR__ . '/../../../common/config/env.php', __DIR__ . '/../../../common/config/local-test.php', 'main', 'test'))); // Migrate up for the test db $runner = new CConsoleCommandRunner(); $consoleCommands = (require __DIR__ . '/../../../console/config/console.php'); $runner->commands = array('migrate' => array_merge($consoleCommands['commandMap']['migrate'], array('interactive' => false))); $runner->run(array('yiic', 'migrate')); // Any file-system dependent data preparations. For example renaming user's uploads // folder, and creating another with testing images /** * @TODO: Start selenium server, if it is not running * * It may be done using command like this. But we have to redirect output to another * stream. If we'll not do this php script running will nang * * system('java -jar /var/www/selenium-server-standalone-2.35.0.jar'); * */
<?php /** * Custom console.php config file. * * @author Antonio Ramirez <*****@*****.**> * @link http://www.ramirezcobos.com/ * @link http://www.2amigos.us/ * @copyright 2013 2amigOS! Consultation Group LLC * @license http://www.opensource.org/licenses/bsd-license.php New BSD License */ /** * Include required classes */ require_once dirname(__FILE__) . '/../Helpers/Initializer.php'; require_once dirname(__FILE__) . '/../Helpers/ArrayX.php'; /** * Return the configuration array appending composer callback methods */ return Yiinitializr\Helpers\ArrayX::merge(Yiinitializr\Helpers\Initializer::config('console', array(dirname(__FILE__) . '/../../../config/main.php', dirname(__FILE__) . '/../../../config/env.php', dirname(__FILE__) . '/../../../config/local.php')), array('params' => array('composer.callbacks' => array('post-update' => array('yiic', 'migrate'), 'post-install' => array('yiic', 'migrate')))));
<?php /** * Custom *EXAMPLE* console.php config file. * * @author Antonio Ramirez <*****@*****.**> * @link http://www.ramirezcobos.com/ * @link http://www.2amigos.us/ * @copyright 2013 2amigOS! Consultation Group LLC * @license http://www.opensource.org/licenses/bsd-license.php New BSD License */ /** * Include required classes */ require_once dirname(__FILE__) . '/../Helpers/Initializer.php'; require_once dirname(__FILE__) . '/../Helpers/ArrayX.php'; /** * Return the configuration array appending composer callback methods */ return Yiinitializr\Helpers\ArrayX::merge(Yiinitializr\Helpers\Initializer::config('console', array('common', 'env', 'local')), array('params' => array('composer.callbacks' => array('post-update' => array('yiic', 'migrate'), 'post-install' => array('yiic', 'migrate')))));