/**
  * Create the Method class instance that represents the constructor of the class
  * under test.
  *
  * @param PhpClass $class
  *
  * @return Method|null
  */
 public function createConstructor(PhpClass $class)
 {
     $classUnderTest = $class->getReflectionClass();
     $reflectionMethod = $classUnderTest->getConstructor();
     if (!$reflectionMethod) {
         return null;
     }
     $method = new Method($class, $reflectionMethod);
     return $method;
 }
Exemple #2
0
 /**
  * @param string $methodName the name of the method to read
  *
  * @return PHPDoc\Annotations[]
  */
 private function getMethodAnnotations($methodName)
 {
     return $this->docCommentToAnnotations(new \ReflectionMethod($this->inClass->getPhpClassName()->getFullyQualifiedClassName(), $methodName));
 }
 /**
  * Get the class name of the class being mocked.
  *
  * @return string
  */
 public function getClassNameBeingMocked()
 {
     $phpClassName = $this->phpClass->getPhpClassName();
     $className = $phpClassName->getFullyQualifiedClassName();
     return $className;
 }