当前位置: 首页>>代码示例>>PHP>>正文


PHP Configuration::actions方法代码示例

本文整理汇总了PHP中Codeception\Configuration::actions方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::actions方法的具体用法?PHP Configuration::actions怎么用?PHP Configuration::actions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Codeception\Configuration的用法示例。


在下文中一共展示了Configuration::actions方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $suites = $this->getSuites($input->getOption('config'));
     $output->writeln("<info>Building Guy classes for suites: " . implode(', ', $suites) . '</info>');
     foreach ($suites as $suite) {
         $settings = $this->getSuiteConfig($suite, $input->getOption('config'));
         $namespace = rtrim($settings['namespace'], '\\');
         $modules = \Codeception\Configuration::modules($settings);
         $code = array();
         $methodCounter = 0;
         $output->writeln('<info>' . $settings['class_name'] . "</info> includes modules: " . implode(', ', array_keys($modules)));
         $docblock = array();
         foreach ($modules as $module) {
             $docblock[] = "use " . get_class($module) . ";";
         }
         $methods = array();
         $actions = \Codeception\Configuration::actions($modules);
         foreach ($actions as $action => $moduleName) {
             if (in_array($action, $methods)) {
                 continue;
             }
             $module = $modules[$moduleName];
             $method = new \ReflectionMethod(get_class($module), $action);
             $code[] = $this->addMethod($method);
             $methods[] = $action;
             $methodCounter++;
         }
         $docblock = $this->prependAbstractGuyDocBlocks($docblock);
         $contents = sprintf($this->template, $namespace ? "namespace {$namespace};" : '', implode("\n", $docblock), 'class', $settings['class_name'], '\\Codeception\\AbstractGuy', implode("\n\n ", $code));
         $file = $settings['path'] . $this->getClassName($settings['class_name']) . '.php';
         $this->save($file, $contents, true);
         $output->writeln("{$settings['class_name']}.php generated successfully. {$methodCounter} methods added");
     }
 }
开发者ID:gargallo,项目名称:tfs-test,代码行数:34,代码来源:Build.php

示例2: testActions

 public function testActions()
 {
     $modules = array('EmulateModuleHelper' => new \Codeception\Module\EmulateModuleHelper());
     $actions = \Codeception\Configuration::actions($modules);
     $this->assertArrayHasKey('seeEquals', $actions);
     $this->assertEquals('EmulateModuleHelper', $actions['seeEquals']);
 }
开发者ID:BatVane,项目名称:Codeception,代码行数:7,代码来源:ConfigurationTest.php

示例3: initializeModules

 protected function initializeModules()
 {
     self::$modules = Configuration::modules($this->settings);
     self::$actions = Configuration::actions(self::$modules);
     foreach (self::$modules as $module) {
         $module->_initialize();
     }
 }
开发者ID:alexanderkuz,项目名称:test-yii2,代码行数:8,代码来源:SuiteManager.php

示例4: testActionsInExtendedModule

 /**
  * @group core
  */
 public function testActionsInExtendedModule()
 {
     $modules = array('PhpSiteHelper' => new \Codeception\Module\PhpSiteHelper());
     $actions = \Codeception\Configuration::actions($modules);
     $this->assertArrayHasKey('amOnPage', $actions);
     $this->assertArrayHasKey('see', $actions);
     $this->assertArrayHasKey('click', $actions);
 }
开发者ID:pfz,项目名称:codeception,代码行数:11,代码来源:ConfigurationTest.php

示例5: __construct

 public function __construct(EventDispatcher $dispatcher, $name, $settings)
 {
     $this->settings = array_merge($this->defaults, $settings);
     $this->dispatcher = $dispatcher;
     $this->suite = $this->createSuite($name);
     $this->path = $settings['path'];
     $this->settings['bootstrap'] = $this->path . $settings['bootstrap'];
     self::$modules = \Codeception\Configuration::modules($settings);
     self::$actions = \Codeception\Configuration::actions(self::$modules);
 }
开发者ID:nike-17,项目名称:Codeception,代码行数:10,代码来源:SuiteManager.php

示例6: __construct

 public function __construct($settings)
 {
     $this->settings = $settings;
     $this->modules = \Codeception\Configuration::modules($settings);
     $this->actions = \Codeception\Configuration::actions($this->modules);
 }
开发者ID:hilmysyarif,项目名称:erp,代码行数:6,代码来源:Actor.php

示例7: testActionsExplicitlySetForNotInheritedModule

 /**
  * @group core
  */
 public function testActionsExplicitlySetForNotInheritedModule()
 {
     \Codeception\Module\PhpSiteHelper::$onlyActions = array('see');
     $modules = array('PhpSiteHelper' => new \Codeception\Module\PhpSiteHelper());
     $actions = \Codeception\Configuration::actions($modules);
     $this->assertArrayNotHasKey('amOnPage', $actions);
     $this->assertArrayHasKey('see', $actions);
 }
开发者ID:lenninsanchez,项目名称:donadores,代码行数:11,代码来源:ConfigurationTest.php


注:本文中的Codeception\Configuration::actions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。