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