public function process(\ReflectionProperty $property, TestCase $test)
    {
        /** @var \ReflectionProperty $property */
        $propertyDocComment = $property->getDocComment();
        if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) {
            $isPrivate = $property->isPrivate();
            if ($isPrivate) {
                $property->setAccessible(true);
            }
            $mock = $this->mockObjectFactory->create($matches[1]);
            $property->setValue($test, $mock);
            if ($isPrivate) {
                $property->setAccessible(false);
            }
        }
    }
public function process(\ReflectionProperty $property, TestCase $test)
    {
        /** @var \ReflectionProperty $property */
        $propertyDocComment = $property->getDocComment();
        if (preg_match(self::REGEX_MOCK, $propertyDocComment, $matches)) {
            $isPrivate = $property->isPrivate();
            if ($isPrivate) {
                $property->setAccessible(true);
            }
            $mock = $this->mockObjectFactory->create($matches[1]);
            $property->setValue($test, $mock);
            if ($isPrivate) {
                $property->setAccessible(false);
            }
        }
    }
public function process ( \ ReflectionProperty $ property , TestCase $ test ) { /** @var \ReflectionProperty $property */ $ propertyDocComment = $ property -> getDocComment ( ) ; if ( preg_match ( self :: REGEX_MOCK , $ propertyDocComment , $ matches ) ) { $ isPrivate = $ property -> isPrivate ( ) ; if ( $ isPrivate ) { $ property -> setAccessible ( true ) ; } $ mock = $ this -> mockObjectFactory -> create ( $ matches [ 1 ] ) ; $ property -> setValue ( $ test , $ mock ) ; if ( $ isPrivate ) { $ property -> setAccessible ( false ) ; } } }
Property processing
Generate and assign mock object to property if it has @Mock annoitation
@param \ReflectionProperty $property
@param TestCase $test
@return void
Property processing Generate and assign mock object to property if it has