/**
* @constructor
* @param string $class
* @param string $name
* @param string $path
*/
public function __construct($class = '', $name = '', $path = '')
{
$this->initObjectManager();
if (!$class || !class_exists($class, false)) {
$this->addTest(self::warning(sprintf('Test Case Class is not valid or empty: "%s"', $class)));
return;
}
if (!$name) {
$this->addTest(self::warning(sprintf('Test Method Should be set for InjectableMethod class. Test Case Class: %s', $class)));
return;
}
$this->setName($name);
$arguments = ['class' => $class, 'path' => $path, 'name' => $name];
$theClass = new \ReflectionClass($class);
$method = $theClass->getMethod($name);
if (!$this->isPublicTestMethod($method)) {
return;
}
$methodName = $method->getName();
$test = self::createTest($theClass, $methodName, $arguments);
if ($test instanceof \PHPUnit_Framework_TestCase || $test instanceof InjectableMethod) {
$test->setDependencies(\PHPUnit_Util_Test::getDependencies($class, $methodName));
}
$this->addTest($test, \PHPUnit_Util_Test::getGroups($class, $methodName));
$this->testCase = true;
}