/** * @param mixed $data * * @return static */ public function setData($data) { $fullClassName = $this->composer->getClassNamespace($data['name']); $data = array_merge(['namespace' => Utils::getJustNamespace($fullClassName), 'className' => Utils::getJustClassName($fullClassName)], $data); $this->data = $data; return $this; }
public function getTestPath($name) { $name = $this->getClassNamespace($name); $name = Str::substr($name, strlen($this->getRootNamespace()) + 1); $switchToDirectorySlashes = Utils::switchToDirectorySlashes($name); return 'tests' . DIRECTORY_SEPARATOR . str_replace(DIRECTORY_SEPARATOR, "", $switchToDirectorySlashes) . 'Test.php'; }
public function setData($data) { $fullClassName = $this->composer->getClassNamespace($data['name']); $testName = str_replace("\\", "", Str::substr($fullClassName, strlen($this->composer->getRootNamespace()) + 1)) . 'Test'; $data = array_merge(['namespace' => Utils::getJustNamespace($fullClassName), 'className' => Utils::getJustClassName($fullClassName), 'testName' => $testName], $data); $this->data = $data; return $this; }