<?php require __DIR__ . '/../vendor/autoload.php'; \Codeception\Util\Autoload::addNamespace('WebChemistry\\Images', __DIR__ . '/../src'); \Codeception\Util\Autoload::addNamespace('', __DIR__ . '/includes');
protected static function autoloadHelpers() { $namespace = self::$config['namespace']; Autoload::addNamespace($namespace, self::supportDir()); // deprecated Autoload::addNamespace($namespace . '\\Codeception\\Module', self::supportDir()); }
<?php // This is global bootstrap for autoloading use Codeception\Util\Autoload; require_once __DIR__ . '/../vendor/autoload.php'; Autoload::addNamespace('', __DIR__ . '/unit/'); Autoload::addNamespace('', __DIR__ . '/../src');
<?php \Codeception\Util\Autoload::addNamespace('Page', __DIR__ . '/_support/_pages');
<?php // Here you can initialize variables that will be available to your tests use Codeception\Util\Autoload; Autoload::addNamespace('', __DIR__ . '/unit/');
<?php // Here you can initialize variables that will be available to your tests use Phalcon\Mvc\Application; use Phalcon\DI\FactoryDefault; use Codeception\Util\Fixtures; use Codeception\Util\Autoload; defined('APP_PATH') || define('APP_PATH', dirname(dirname(dirname(__FILE__)))); defined('CONFIG_PATH') || define('CONFIG_PATH', dirname(dirname(__FILE__))); require APP_PATH . "/vendor/autoload.php"; $config = (include CONFIG_PATH . "/config/config.php"); $di = new FactoryDefault(); require CONFIG_PATH . "/config/services.php"; $application = new Application(); $application->setDI($di); Fixtures::add("app", $application); Autoload::addNamespace('SimpleHelpers\\Libs\\Github', '/src/');
<?php /** * ownCloud - gallery * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Olivier Paroz <*****@*****.**> * * @copyright Olivier Paroz 2015 */ use Codeception\Util\Autoload; define('PHPUNIT_RUN', 1); // Add core require_once __DIR__ . '/../../../lib/base.php'; // Add core tests to the list of valid paths OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests'); // Give access to core tests to Codeception Autoload::addNamespace('Test', '/../../../tests/lib'); // Load all apps OC_App::loadApps(); OC_Hook::clear();
<?php // This is global bootstrap for autoloading use Codeception\Util\Autoload; Autoload::addNamespace('tempsmsru', '.');
<?php \Codeception\Util\Autoload::addNamespace('CliGuy', __DIR__ . DIRECTORY_SEPARATOR . '_steps');
<?php use Codeception\Util\Autoload; use Codeception\Util\Fixtures; /** * Bootstrap for Codeception tests * * @author Gawain Lynch <*****@*****.**> */ Autoload::addNamespace('\\', __DIR__); // User IDs Fixtures::add('users', ['admin' => ['username' => 'admin', 'password' => 'topsecret', 'email' => '*****@*****.**', 'displayname' => 'Admin Person'], 'author' => ['username' => 'author', 'password' => 'iamanartisandarnit', 'email' => '*****@*****.**', 'displayname' => 'Author Person'], 'editor' => ['username' => 'editor', 'password' => 'nomoresecrets', 'email' => '*****@*****.**', 'displayname' => 'Editor Person'], 'manager' => ['username' => 'manager', 'password' => 'cantkeepsecrets', 'email' => '*****@*****.**', 'displayname' => 'Manager Person'], 'developer' => ['username' => 'developer', 'password' => '~n0Tne1k&nGu3$$', 'email' => '*****@*****.**', 'displayname' => 'Developer Person'], 'lemmings' => ['username' => 'lemmings', 'password' => 'MikeDaillyDavidJones', 'email' => '*****@*****.**', 'displayname' => 'Lemmings Person']]); // Files that we'll backup. If they exist when we run, then we keep the // original in tact before starting the suite run Fixtures::add('backups', [INSTALL_ROOT . '/app/config/config.yml' => false, INSTALL_ROOT . '/app/config/contenttypes.yml' => false, INSTALL_ROOT . '/app/config/menu.yml' => false, INSTALL_ROOT . '/app/config/permissions.yml' => false, INSTALL_ROOT . '/app/config/routing.yml' => false, INSTALL_ROOT . '/app/config/taxonomy.yml' => false, BOLT_ROOT . '/app/resources/translations/en_GB/messages.en_GB.yml' => true, BOLT_ROOT . '/app/resources/translations/en_GB/infos.en_GB.yml' => true, BOLT_ROOT . '/app/resources/translations/en_GB/contenttypes.en_GB.yml' => true, INSTALL_ROOT . '/app/database/bolt.db' => false, INSTALL_ROOT . '/theme/base-2016/partials/_footer.twig' => true]); // Session and authentication tokens Fixtures::add('tokenNames', ['session' => 'bolt_session_' . md5('localhost:8123'), 'authtoken' => 'bolt_authtoken_' . md5('localhost:8123')]); // Temporary hack restore_error_handler();
<?php // This is global bootstrap for autoloading use Codeception\Util\Autoload; Autoload::addNamespace('consultnn\\helpers', codecept_root_dir());
/** * Loads global config file which is `codeception.yml` by default. * When config is already loaded - returns it. * * @param null $configFile * @return array * @throws Exception\ConfigurationException */ public static function config($configFile = null) { if (!$configFile && self::$config) { return self::$config; } if (self::$config && self::$lock) { return self::$config; } if ($configFile === null) { $configFile = getcwd() . DIRECTORY_SEPARATOR . 'codeception.yml'; } if (is_dir($configFile)) { $configFile = $configFile . DIRECTORY_SEPARATOR . 'codeception.yml'; } $dir = realpath(dirname($configFile)); self::$dir = $dir; $configDistFile = $dir . DIRECTORY_SEPARATOR . 'codeception.dist.yml'; if (!(file_exists($configDistFile) || file_exists($configFile))) { throw new ConfigurationException("Configuration file could not be found.\nRun `bootstrap` to initialize Codeception.", 404); } // Preload config to retrieve params such that they are applied to codeception config file below $tempConfig = self::$defaultConfig; $distConfigContents = ""; if (file_exists($configDistFile)) { $distConfigContents = file_get_contents($configDistFile); $tempConfig = self::mergeConfigs($tempConfig, self::getConfFromContents($distConfigContents)); } $configContents = ""; if (file_exists($configFile)) { $configContents = file_get_contents($configFile); $tempConfig = self::mergeConfigs($tempConfig, self::getConfFromContents($configContents)); } self::prepareParams($tempConfig); $config = self::mergeConfigs(self::$defaultConfig, self::getConfFromContents($distConfigContents)); $config = self::mergeConfigs($config, self::getConfFromContents($configContents)); if ($config == self::$defaultConfig) { throw new ConfigurationException("Configuration file is invalid"); } self::$config = $config; if (!isset($config['paths']['log'])) { throw new ConfigurationException('Log path is not defined by key "paths: log"'); } self::$logDir = $config['paths']['log']; // fill up includes with wildcard expansions $config['include'] = self::expandWildcardedIncludes($config['include']); // config without tests, for inclusion of other configs if (count($config['include']) and !isset($config['paths']['tests'])) { return self::$config = $config; } if (!isset($config['paths']['tests'])) { throw new ConfigurationException('Tests directory is not defined in Codeception config by key "paths: tests:"'); } if (!isset($config['paths']['data'])) { throw new ConfigurationException('Data path is not defined Codeception config by key "paths: data"'); } // compatibility with 1.x, 2.0 if (!isset($config['paths']['support']) and isset($config['paths']['helpers'])) { $config['paths']['support'] = $config['paths']['helpers']; } if (!isset($config['paths']['support'])) { throw new ConfigurationException('Helpers path is not defined by key "paths: support"'); } self::$dataDir = $config['paths']['data']; self::$supportDir = $config['paths']['support']; self::$testsDir = $config['paths']['tests']; if (isset($config['paths']['envs'])) { self::$envsDir = $config['paths']['envs']; } Autoload::addNamespace(self::$config['namespace'], self::supportDir()); self::loadBootstrap($config['settings']['bootstrap']); self::loadSuites(); return $config; }
use RuntimeException; use WellCart\Mvc\Application; use WellCart\Utility\Config; use WellCart\Utility\PHPEnvironment; if (is_file(__DIR__ . '/../../../bootstrap.php')) { require_once __DIR__ . '/../../../bootstrap.php'; } if (!defined('WELLCART')) { define('WELLCART', true); chdir(__DIR__); /** * Bootstrap module tests */ Bootstrap::init(); } CodeceptionAutoload::addNamespace('WellCart\\Theme\\BackendUi\\Test', __DIR__ . '/support'); /** * Bootstrap test environment */ class Bootstrap { /** * Initialize testing environment * * @return void */ public static function init() { if (is_file(__DIR__ . '/config/.env')) { Dotenv::load(['filepath' => __DIR__ . '/config/.env', 'toEnv' => true]); }
<?php \Codeception\Util\Autoload::addNamespace('Project\\Command', __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'examples');