當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Codeception\Module類代碼示例

本文整理匯總了PHP中Codeception\Module的典型用法代碼示例。如果您正苦於以下問題:PHP Module類的具體用法?PHP Module怎麽用?PHP Module使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Module類的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();
     }
 }
開發者ID:spryker,項目名稱:Transfer,代碼行數:11,代碼來源:TransferGenerate.php

示例2: _initialize

 public function _initialize()
 {
     if (!function_exists('xmlrpc_encode_request')) {
         throw new ModuleRequireException(__CLASS__, "XMLRPC module requires installed php_xmlrpc extension");
     }
     parent::_initialize();
 }
開發者ID:lenninsanchez,項目名稱:donadores,代碼行數:7,代碼來源:XMLRPC.php

示例3: __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();
     }
 }
開發者ID:spryker,項目名稱:Propel,代碼行數:11,代碼來源:PropelInstall.php

示例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();
     }
 }
開發者ID:spryker,項目名稱:Config,代碼行數:12,代碼來源:ConfigInit.php

示例5: validateConfig

 /**
  * Ensure the class specified is valid.
  *
  * @see \Codeception\Module::validateConfig()
  * @throws \Codeception\Exception\ModuleConfig
  */
 protected function validateConfig()
 {
     parent::validateConfig();
     $class = $this->config['class'];
     if (!class_exists($class)) {
         throw new \Codeception\Exception\ModuleConfig("DrupalVariable", "Invalid config. Class '{$class}' does not exist");
     }
     $interface = "Codeception\\Module\\Drupal\\Variable\\VariableStorage\\StorageInterface";
     if (!in_array($interface, class_implements($class))) {
         throw new \Codeception\Exception\ModuleConfig("DrupalVariable", "Invalid config. Class '{$class}' must implement '{$interface}'");
     }
 }
開發者ID:ixis,項目名稱:codeception-drupal-variable,代碼行數:18,代碼來源:DrupalVariable.php

示例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);
 }
開發者ID:dustinleblanc,項目名稱:codeception-drupal-8,代碼行數:16,代碼來源:Drupal8.php

示例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]);
     }
 }
開發者ID:cubicmushroom,項目名稱:project-toolbelt,代碼行數:18,代碼來源:Functional.php

示例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');
 }
開發者ID:cubicmushroom,項目名稱:project-toolbelt,代碼行數:20,代碼來源:JsonFile.php

示例9: __construct

 /**
  * @param ModuleContainer $container
  * @param null $config
  */
 public function __construct(ModuleContainer $container, $config = null)
 {
     parent::__construct($container, $config);
 }
開發者ID:rezouce,項目名稱:codeception-mongodb-cleanstate,代碼行數:8,代碼來源:MongoDbCleanState.php

示例10: _after

 /**
  * {@inheritDoc}
  * @see \Codeception\Module::_after()
  */
 public function _after(TestCase $testCase)
 {
     parent::_after($testCase);
     $this->throwExceptionOnHttpMockError();
     $this->diManager->get('httpMockServer')->clean();
 }
開發者ID:mcustiel,項目名稱:codeception-http-mock,代碼行數:10,代碼來源:HttpMock.php

示例11: __construct

 public function __construct(ModuleContainer $moduleContainer, $config, WP $wp = null)
 {
     parent::__construct($moduleContainer, $config);
     $this->wp = $wp ? $wp : new WP();
 }
開發者ID:lucatume,項目名稱:wp-browser,代碼行數:5,代碼來源:WPLoader.php

示例12: _failed

 /**
  * @param \Codeception\TestCase $test
  * @param bool $fail
  *
  * @return void
  */
 public function _failed(TestCase $test, $fail)
 {
     parent::_failed($test, $fail);
     if (session_status() === PHP_SESSION_ACTIVE) {
         session_destroy();
     }
 }
開發者ID:spryker,項目名稱:Transfer,代碼行數:13,代碼來源:Functional.php

示例13: validateConfig

 /**
  * Provide and override for the config settings and allow custom settings depending on the service being used.
  */
 protected function validateConfig()
 {
     $this->IMDriver = $this->createIMDriver();
     $this->requiredFields = $this->IMDriver->getRequiredConfig();
     $this->config = array_merge($this->IMDriver->getDefaultConfig(), $this->config);
     parent::validateConfig();
 }
開發者ID:nathanmac,項目名稱:im-codeception-module,代碼行數:10,代碼來源:IM.php

示例14: _before

 public function _before(\Codeception\TestCase $test)
 {
     parent::_before($test);
     /////////////////////////////////////
     // initialize your database here
     /////////////////////////////////////
 }
開發者ID:mjarschel,項目名稱:komenco,代碼行數:7,代碼來源:UIHelper.php

示例15: _failed

 /**
  * @param \Codeception\TestCase $test
  * @param bool $fail
  *
  * @return void
  */
 public function _failed(TestCase $test, $fail)
 {
     parent::_failed($test, $fail);
     Propel::getWriteConnection('zed')->rollBack();
     if (session_status() === PHP_SESSION_ACTIVE) {
         session_destroy();
     }
 }
開發者ID:spryker,項目名稱:Stock,代碼行數:14,代碼來源:Functional.php


注:本文中的Codeception\Module類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。