option('unit')) { return __DIR__.'/stubs/unit-test.stub'; } return __DIR__.'/stubs/test.stub'; } /** * Get the destination class path. * * @param string $name * @return string */ protected function getPath($name) { $name = Str::replaceFirst($this->rootNamespace(), '', $name); return base_path('tests').str_replace('\\', '/', $name).'.php'; } /** * Get the default namespace for the class. * * @param string $rootNamespace * @return string */ protected function getDefaultNamespace($rootNamespace) { if ($this->option('unit')) { return $rootNamespace.'\Unit'; } else { return $rootNamespace.'\Feature'; } } /** * Get the root namespace for the class. * * @return string */ protected function rootNamespace() { return 'Tests'; } }