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


PHP PHPUnit_Util_Test::getDependencies方法代码示例

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


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

示例1: __construct

 /**
  * @constructor
  * @param string $class
  * @param string $name
  * @param string $path
  */
 public function __construct($class = '', $name = '', $path = '')
 {
     $this->initObjectManager();
     if (!$class || !class_exists($class, false)) {
         $this->addTest(self::warning(sprintf('Test Case Class is not valid or empty: "%s"', $class)));
         return;
     }
     if (!$name) {
         $this->addTest(self::warning(sprintf('Test Method Should be set for InjectableMethod class. Test Case Class: %s', $class)));
         return;
     }
     $this->setName($name);
     $arguments = ['class' => $class, 'path' => $path, 'name' => $name];
     $theClass = new \ReflectionClass($class);
     $method = $theClass->getMethod($name);
     if (!$this->isPublicTestMethod($method)) {
         return;
     }
     $methodName = $method->getName();
     $test = self::createTest($theClass, $methodName, $arguments);
     if ($test instanceof \PHPUnit_Framework_TestCase || $test instanceof InjectableMethod) {
         $test->setDependencies(\PHPUnit_Util_Test::getDependencies($class, $methodName));
     }
     $this->addTest($test, \PHPUnit_Util_Test::getGroups($class, $methodName));
     $this->testCase = true;
 }
开发者ID:Mohitsahu123,项目名称:mtf,代码行数:32,代码来源:InjectableMethod.php

示例2: enhancePhpunitTest

 protected function enhancePhpunitTest(\PHPUnit_Framework_TestCase $test)
 {
     $className = get_class($test);
     $methodName = $test->getName(false);
     $dependencies = \PHPUnit_Util_Test::getDependencies($className, $methodName);
     $test->setDependencies($dependencies);
     if ($test instanceof TestCaseFormat) {
         $test->getMetadata()->setDependencies($dependencies);
         $test->getMetadata()->setEnv(Annotation::forMethod($test, $methodName)->fetchAll('env'));
     }
 }
开发者ID:foxman209,项目名称:Codeception,代码行数:11,代码来源:Unit.php

示例3: enhancePhpunitTest

 protected function enhancePhpunitTest(\PHPUnit_Framework_TestCase $test)
 {
     $className = get_class($test);
     $methodName = $test->getName(false);
     $dependencies = \PHPUnit_Util_Test::getDependencies($className, $methodName);
     $test->setDependencies($dependencies);
     if ($test instanceof UnitFormat) {
         $feature = $test->getName();
         $feature = preg_replace('/([A-Z]+)([A-Z][a-z])/', '\\1 \\2', $feature);
         $feature = preg_replace('/([a-z\\d])([A-Z])/', '\\1 \\2', $feature);
         $test->getMetadata()->setFeature(strtolower($feature));
         $test->getMetadata()->setDependencies($dependencies);
         $test->getMetadata()->setEnv(Annotation::forMethod($test, $methodName)->fetchAll('env'));
     }
 }
开发者ID:neronmoon,项目名称:Codeception,代码行数:15,代码来源:Unit.php

示例4: addTestMethod

 /**
  * @param ReflectionClass  $class
  * @param ReflectionMethod $method
  */
 protected function addTestMethod(ReflectionClass $class, ReflectionMethod $method)
 {
     if (!$this->isTestMethod($method)) {
         return;
     }
     $name = $method->getName();
     if (!$method->isPublic()) {
         $this->addTest(self::warning(sprintf('Test method "%s" in test class "%s" is not public.', $name, $class->getName())));
         return;
     }
     $test = self::createTest($class, $name);
     if ($test instanceof PHPUnit_Framework_TestCase || $test instanceof PHPUnit_Framework_TestSuite_DataProvider) {
         $test->setDependencies(PHPUnit_Util_Test::getDependencies($class->getName(), $name));
     }
     $this->addTest($test, PHPUnit_Util_Test::getGroups($class->getName(), $name));
 }
开发者ID:441420776,项目名称:phpunit,代码行数:20,代码来源:TestSuite.php

示例5: testParseAnnotationThatIsOnlyOneLine

 public function testParseAnnotationThatIsOnlyOneLine()
 {
     $this->assertEquals(array('Bar'), PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotationThatIsOnlyOneLine'));
 }
开发者ID:nizarbey,项目名称:phpunit-all-in-one,代码行数:4,代码来源:TestTest.php

示例6: createTestFromCestMethod

 protected function createTestFromCestMethod($cestInstance, $methodName, $file)
 {
     if (strpos($methodName, '_') === 0 or $methodName == '__construct') {
         return null;
     }
     $testClass = get_class($cestInstance);
     $cest = new Cest();
     $cest->configName($methodName)->configFile($file)->config('testClassInstance', $cestInstance)->config('testMethod', $methodName)->initConfig();
     $cest->getScenario()->env(Annotation::forMethod($testClass, $methodName)->fetchAll('env'));
     $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName));
     return $cest;
 }
开发者ID:Eli-TW,项目名称:Codeception,代码行数:12,代码来源:TestLoader.php

示例7: testParseAnnotation

 public function testParseAnnotation()
 {
     $this->assertEquals(array('Foo', 'ほげ'), PHPUnit_Util_Test::getDependencies(get_class($this), 'methodForTestParseAnnotation'));
 }
开发者ID:proofek,项目名称:phpunit,代码行数:4,代码来源:TestTest.php

示例8: addTestDependencies

 /**
  * Takes a test and adds its dependencies
  *
  * @param PHPUnit_Framework_Test $test Object. A Test can be run and collect its results
  * @param string $className  Name of class what loaded to parsing and execute
  * @param string $methodName Name of method what loaded from class to adding dependencies
  *
  * @return void
  */
 public static function addTestDependencies(PHPUnit_Framework_Test $test, $className, $methodName)
 {
     if ($test instanceof PHPUnit_Framework_TestCase || $test instanceof PHPUnit_Framework_TestSuite_DataProvider) {
         $test->setDependencies(PHPUnit_Util_Test::getDependencies($className, $methodName));
     }
     return $test;
 }
开发者ID:signativa,项目名称:Magento-Test-Automation-Framework,代码行数:16,代码来源:TestCase.php

示例9: createTestFromCestMethod

 protected function createTestFromCestMethod($cestInstance, $methodName, $file)
 {
     if (strpos($methodName, '_') === 0 || $methodName == '__construct') {
         return null;
     }
     $testClass = get_class($cestInstance);
     $cest = new Cest();
     $cest->configName($methodName)->configFile($file)->config('testClassInstance', $cestInstance)->config('testMethod', $methodName);
     $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName));
     return $cest;
 }
开发者ID:IvanZuev,项目名称:Codeception,代码行数:11,代码来源:TestLoader.php

示例10: createTestFromCestMethod

 protected function createTestFromCestMethod($cestInstance, $methodName, $file)
 {
     $testClass = get_class($cestInstance);
     if (strpos($methodName, '_') === 0) {
         return;
     }
     $guy = $this->settings['namespace'] ? $this->settings['namespace'] . '\\Codeception\\' . $this->settings['class_name'] : $this->settings['class_name'];
     $target = $testClass . '::' . $methodName;
     $cest = new TestCase\Cest($this->dispatcher, array('name' => $target, 'instance' => $cestInstance, 'method' => $methodName, 'file' => $file, 'bootstrap' => $this->settings['bootstrap'], 'guy' => $guy));
     $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName));
     $cest->preload();
     return $cest;
 }
开发者ID:NaszvadiG,项目名称:ImageCMS,代码行数:13,代码来源:SuiteManager.php

示例11: addGeneratedTestTo

 private static function addGeneratedTestTo(PHPUnit_Framework_TestSuite $suite, PHPUnit_Framework_TestCase $test, $classGroups)
 {
     list($methodName, ) = explode(' ', $test->getName());
     $test->setDependencies(PHPUnit_Util_Test::getDependencies(get_class($test), $methodName));
     $suite->addTest($test, $classGroups);
 }
开发者ID:DaveNascimento,项目名称:civicrm-packages,代码行数:6,代码来源:SeleniumTestSuite.php

示例12: createTestFromCestMethod

 protected function createTestFromCestMethod($cestInstance, $methodName, $file, $guy)
 {
     $testClass = get_class($cestInstance);
     if (strpos($methodName, '_') === 0) {
         return;
     }
     $overriddenGuy = Annotation::forMethod($testClass, $methodName)->fetch('guy');
     if (!$overriddenGuy) {
         $overriddenGuy = Annotation::forClass($testClass)->fetch('guy');
     }
     if ($overriddenGuy) {
         $guy = $overriddenGuy;
     }
     $cest = new TestCase\Cest($this->dispatcher, array('name' => $methodName, 'instance' => $cestInstance, 'method' => $methodName, 'file' => $file, 'bootstrap' => $this->settings['bootstrap'], 'guy' => $guy));
     $cest->getScenario()->env(Annotation::forMethod($testClass, $methodName)->fetchAll('env'));
     $cest->getScenario()->groups(\PHPUnit_Util_Test::getGroups($testClass, $methodName));
     $cest->setDependencies(\PHPUnit_Util_Test::getDependencies($testClass, $methodName));
     $cest->preload();
     return $cest;
 }
开发者ID:lenninsanchez,项目名称:donadores,代码行数:20,代码来源:SuiteManager.php


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