Author: Roman Ishchenko (roman@ishchenko.ck.ua)
Example #1
0
 /**
  * @return ObjectProperty[]
  */
 private function getSpecifyObjectProperties()
 {
     $objectReflection = new \ReflectionObject($this);
     $propertiesToClone = $objectReflection->getProperties();
     if (($classProperties = $this->specifyGetClassPrivateProperties()) !== []) {
         $propertiesToClone = array_merge($propertiesToClone, $classProperties);
     }
     $properties = [];
     foreach ($propertiesToClone as $property) {
         if ($this->specifyConfig->propertyIgnored($property->getName())) {
             continue;
         }
         $properties[] = new ObjectProperty($this, $property);
     }
     // isolate mockObjects property from PHPUnit_Framework_TestCase
     if (($phpUnitReflection = $this->specifyGetPhpUnitReflection()) !== null) {
         $properties[] = $mockObjects = new ObjectProperty($this, $phpUnitReflection->getProperty('mockObjects'));
         // remove all mock objects inherited from parent scope(s)
         $mockObjects->setValue([]);
     }
     return $properties;
 }