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


PHP SimpleReflection::getParent方法代碼示例

本文整理匯總了PHP中SimpleReflection::getParent方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleReflection::getParent方法的具體用法?PHP SimpleReflection::getParent怎麽用?PHP SimpleReflection::getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleReflection的用法示例。


在下文中一共展示了SimpleReflection::getParent方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: ignoreParentsIfIgnored

 /**
  *    Scans the now complete ignore list, and adds
  *    all parent classes to the list. If a class
  *    is not a runnable test case, then it's parents
  *    wouldn't be either. This is syntactic sugar
  *    to cut down on ommissions of ignore()'s or
  *    missing abstract declarations. This cannot
  *    be done whilst loading classes wiithout forcing
  *    a particular order on the class declarations and
  *    the ignore() calls. It's just nice to have the ignore()
  *    calls at the top of the file before the actual declarations.
  *    @param array $classes     Class names of interest.
  *    @static
  *    @access public
  */
 function ignoreParentsIfIgnored($classes) {
     $registry = &SimpleTest::_getRegistry();
     foreach ($classes as $class) {
         if (SimpleTest::isIgnored($class)) {
             $reflection = new SimpleReflection($class);
             if ($parent = $reflection->getParent()) {
                 SimpleTest::ignore($parent);
             }
         }
     }
 }
開發者ID:nuckey,項目名稱:moodle,代碼行數:26,代碼來源:simpletest.php

示例2: ignoreParentsIfIgnored

 /**
  *    Scans the now complete ignore list, and adds
  *    all parent classes to the list. If a class
  *    is not a runnable test case, then it's parents
  *    wouldn't be either. This is syntactic sugar
  *    to cut down on ommissions of ignore()'s or
  *    missing abstract declarations. This cannot
  *    be done whilst loading classes wiithout forcing
  *    a particular order on the class declarations and
  *    the ignore() calls. It's just nice to have the ignore()
  *    calls at the top of the file before the actual declarations.
  *    @param array $classes     Class names of interest.
  */
 public static function ignoreParentsIfIgnored($classes)
 {
     foreach ($classes as $class) {
         if (SimpleTest::isIgnored($class)) {
             $reflection = new SimpleReflection($class);
             $parent = $reflection->getParent();
             if ($parent) {
                 SimpleTest::ignore($parent);
             }
         }
     }
 }
開發者ID:ilune,項目名稱:simpletest,代碼行數:25,代碼來源:simpletest.php

示例3: testFindingParentClass

 function testFindingParentClass()
 {
     $reflection = new SimpleReflection('AnyOldChildThing');
     $this->assertEqual(strtolower($reflection->getParent()), 'anyoldthing');
 }
開發者ID:ljarray,項目名稱:dbpedia,代碼行數:5,代碼來源:reflection_php4_test.php

示例4: testFindingParentClass

 function testFindingParentClass()
 {
     $reflection = new SimpleReflection('AnyOldSubclass');
     $this->assertEqual($reflection->getParent(), 'AnyOldImplementation');
 }
開發者ID:PublicityPort,項目名稱:OpenCATS,代碼行數:5,代碼來源:reflection_php5_test.php


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