當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。