isAbstract() public method

Trivially determines if the class is abstract.
public isAbstract ( )
Esempio n. 1
0
 function testDetectionOfInterfacesAlwaysFalse()
 {
     $reflection = new SimpleReflection('AnyOldThing');
     $this->assertFalse($reflection->isAbstract());
     $this->assertFalse($reflection->isInterface());
 }
 function testDetectionOfAbstractClass()
 {
     $reflection = new SimpleReflection('AnyOldClass');
     $this->assertTrue($reflection->isAbstract());
 }
Esempio n. 3
0
 /**
  *    Calculates the incoming test cases from a before
  *    and after list of loaded classes. Skips abstract
  *    classes.
  *    @param array $existing_classes   Classes before require().
  *    @param array $new_classes        Classes after require().
  *    @return array                    New classes which are test
  *                                     cases that shouldn't be ignored.
  *    @access private
  */
 function _selectRunnableTests($existing_classes, $new_classes)
 {
     $classes = array();
     foreach ($new_classes as $class) {
         if (in_array($class, $existing_classes)) {
             continue;
         }
         if ($this->_getBaseTestCase($class)) {
             $reflection = new SimpleReflection($class);
             if ($reflection->isAbstract()) {
                 SimpleTest::ignore($class);
             }
             $classes[] = $class;
         }
     }
     return $classes;
 }
Esempio n. 4
0
 /**
  *    Calculates the incoming test cases. Skips abstract
  *    and ignored classes.
  *    @param array $candidates   Candidate classes.
  *    @return array              New classes which are test
  *                               cases that shouldn't be ignored.
  *    @access public
  */
 function selectRunnableTests($candidates) {
     $classes = array();
     foreach ($candidates as $class) {
         if (TestSuite::getBaseTestCase($class)) {
             $reflection = new SimpleReflection($class);
             if ($reflection->isAbstract()) {
                 SimpleTest::ignore($class);
             } else {
                 $classes[] = $class;
             }
         }
     }
     return $classes;
 }
Esempio n. 5
0
 /**
  *    Calculates the incoming test cases. Skips abstract
  *    and ignored classes.
  *    @param array $candidates   Candidate classes.
  *    @return array              New classes which are test
  *                               cases that shouldn't be ignored.
  *    @access public
  */
 function selectRunnableTests($candidates)
 {
     $classes = array();
     foreach ($candidates as $class) {
         if (TestSuite::getBaseTestCase($class)) {
             $reflection = new SimpleReflection($class);
             if ($reflection->isAbstract()) {
                 SimpleTest::ignore($class);
             } else {
                 // only pick classes which do have test methods we can run:
                 $methods = $reflection->getMethods();
                 foreach ($methods as $method) {
                     if (SimpleTestCase::isTest($class, $method)) {
                         $classes[] = $class;
                         break;
                     }
                 }
             }
         }
     }
     return $classes;
 }