本文整理汇总了PHP中Codeception\Module::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Module::__construct方法的具体用法?PHP Module::__construct怎么用?PHP Module::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Codeception\Module
的用法示例。
在下文中一共展示了Module::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param \Codeception\Lib\ModuleContainer $moduleContainer
* @param null $config
*/
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
if (!empty($config['enabled'])) {
$this->generateTransferObjects();
}
}
示例2: __construct
/**
* @param \Codeception\Lib\ModuleContainer $moduleContainer
* @param array|null $config
*/
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
if (!empty($config['enabled'])) {
$this->initPropel();
}
}
示例3: __construct
/**
* WPCLI constructor.
*
* @param ModuleContainer $moduleContainer
* @param null|array $config
* @param Executor|null $executor
*
* @throws ModuleConfigException If specifiec path is not a folder.
*/
public function __construct(ModuleContainer $moduleContainer, $config, Executor $executor = null)
{
parent::__construct($moduleContainer, $config);
if (!is_dir($config['path'])) {
throw new ModuleConfigException(__CLASS__, 'Specified path [' . $config['path'] . '] is not a directory.');
}
$this->executor = $executor ?: new Executor($this->prettyName);
}
示例4: __construct
/**
* @param \Codeception\Lib\ModuleContainer $moduleContainer
* @param null $config
*/
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
if (isset($this->config['enabled']) && $this->config['enabled']) {
$this->copyBundleConfigurationFiles();
$this->generateConfigDefaultFile();
}
}
示例5: __construct
public function __construct($config = null)
{
// terminology: see = isXyz => true/false, have = create, grab = get => data
if (!isset($config['hosts'])) {
throw new \Exception('please configure hosts for ElasticSearch codeception module');
}
if (isset($config['hosts']) && !is_array($config['hosts'])) {
$config['hosts'] = array($config['hosts']);
}
$this->config = (array) $config;
parent::__construct();
}
示例6: __construct
/**
* Drupal8Module constructor.
*/
public function __construct(ModuleContainer $container, $config = null)
{
$this->config = array_merge(['drupal_root' => Configuration::projectDir() . 'web', 'site_path' => 'sites/test', 'create_users' => true, 'destroy_users' => true, 'test_user_pass' => 'test'], (array) $config);
// Bootstrap a bare minimum Kernel so we can interact with Drupal.
$autoloader = (require $this->config['drupal_root'] . '/autoload.php');
$kernel = new TestDrupalKernel('prod', $autoloader, $this->config['drupal_root']);
$kernel->bootTestEnvironment($this->config['site_path']);
// Allow for setting some basic info output.
$this->output = new ConsoleOutput();
// Get our role definitions as we use them a lot.
$this->roles = Role::loadMultiple();
parent::__construct($container);
}
示例7: __construct
/**
* @param ModuleContainer $moduleContainer
* @param null $config
*/
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
$this->fs = $this->getModule('Filesystem');
$packageDir = dirname(dirname(dirname(dirname(__FILE__))));
$this->projectDirTemplate = "{$packageDir}/tests/_data/project_template";
$this->projectRoot = "{$packageDir}/{$config['test_path']}";
// Set the project root for the NpmPackage module
if ($moduleContainer->hasModule('\\CubicMushroom\\Tools\\ProjectToolbelt\\Codeception\\Helper\\NpmPackage')) {
/** @var JsonFile $npmPackageModule */
$npmPackageModule = $moduleContainer->getModule('\\CubicMushroom\\Tools\\ProjectToolbelt\\Codeception\\Helper\\NpmPackage');
$npmPackageModule->_reconfigure([JsonFile::CONFIG_PROJECT_ROOT => $this->projectRoot]);
}
}
示例8: __construct
/**
* @param ModuleContainer $moduleContainer
* @param array $config
*
* @throws ModuleRequireException if required modules are not available
*/
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
$missingModules = [];
foreach ($this->requiredModules as $module) {
if (!$moduleContainer->hasModule($module)) {
$missingModules[] = $module;
}
}
if (!empty($missingModules)) {
throw new ModuleRequireException('Missing the following modules, required by the NpmPackage module are missing...', implode(', ', $missingModules));
}
$this->fs = $moduleContainer->getModule('Filesystem');
}
示例9: __construct
/**
* {@inheritdoc}
*/
public function __construct($config = null)
{
parent::__construct($config);
\Yii::import('system.cli.commands.MigrateCommand');
$configFile = \Yii::getPathOfAlias('application.config.console') . '.php';
$config = (include $configFile);
$this->_command = new \MigrateCommand(null, null);
foreach ($config['commandMap']['migrate'] as $option => $value) {
if ($option === 'class') {
continue;
} else {
if ($option === 'migrationPath') {
$this->_command->{$option} = \Yii::getPathOfAlias($value);
} else {
$this->_command->{$option} = $value;
}
}
}
$this->_command->interactive = false;
static::$_instance = $this;
}
示例10: __construct
/**
* Constructor
*
* @param array|null $config module configuration
*
* @return self
*
* @throws ModuleConfig
*/
public function __construct($config = null)
{
$this->mergeEnvConfig($config);
parent::__construct($config);
$this->setEnvOption($config, self::CONFIG_MODULE, self::ENV_MODULE);
if (!isset(static::$modules[$config[self::CONFIG_MODULE]])) {
throw new ModuleConfig(get_class($this), "\nIncorrect module name given: " . $config[self::CONFIG_MODULE] . "\n\n Please, update the configuration and set module to one of the correct values: " . implode(', ', array_keys(static::$modules)) . "\n\n");
}
$this->moduleName = $config[self::CONFIG_MODULE];
if (!isset($config[$this->moduleName])) {
$config[$this->moduleName] = array();
}
$this->setEnvOption($config, self::CONFIG_URL, self::ENV_URL);
if ($this->isWebDriver()) {
$this->setEnvOption($config[$this->moduleName], self::CONFIG_WD_BROWSER, self::ENV_WD_BROWSER);
$this->setEnvOption($config[$this->moduleName], self::CONFIG_WD_SIZE, self::ENV_WD_SIZE);
}
$config[$this->moduleName][self::CONFIG_URL] = $config[self::CONFIG_URL];
$moduleClass = static::$modules[$this->moduleName];
$this->module = new $moduleClass($config[$this->moduleName]);
$this->runner = new BrowserCommandRunner($this->module);
}
示例11: __construct
/**
* @param ModuleContainer $container
* @param null $config
*/
public function __construct(ModuleContainer $container, $config = null)
{
parent::__construct($container, $config);
}
示例12: __construct
public function __construct(ModuleContainer $moduleContainer, $config, WP $wp = null)
{
parent::__construct($moduleContainer, $config);
$this->wp = $wp ? $wp : new WP();
}
示例13: __construct
public function __construct(ModuleContainer $moduleContainer, $config = null)
{
parent::__construct($moduleContainer, $config);
$this->diManager = new DependencyInjectionService();
}
示例14: __construct
/**
* Create an object from VisualCeption Class
*
* @param array $config
* @return result
*/
public function __construct($config)
{
$result = parent::__construct($config);
$this->init();
return $result;
}
示例15: __construct
public function __construct()
{
parent::__construct();
self::$baseMockPath = __DIR__ . '/mock/';
}