/** * Generate phpunit test file. * * @return void */ protected function phpunitTest() { $file = $this->file->get(__DIR__ . '/stubs/ProjectTest.stub'); $stubs = ['{project_upper}', '{project_camel_case}', '{vendor_upper}', '{namespace}']; $values = [$this->projectUpper, $this->str->toCamelCase($this->projectLower), $this->vendorUpper, $this->createNamespace()]; $content = str_replace($stubs, $values, $file); $this->file->makeDirectory($this->projectLower . '/tests'); $this->file->put($this->projectLower . '/tests/' . $this->projectUpper . 'Test.php', $content); $this->exportIgnores[] = 'tests'; }
/** * Generate phpspec config file, create a specs directory and * add package to development requirements. * * @return void */ protected function phpspec() { $this->developmentRequirements[] = 'phpspec/phpspec'; $file = $this->file->get(__DIR__ . '/stubs/phpspec.stub'); $content = str_replace('{namespace}', $this->createNamespace(), $file); $this->file->makeDirectory($this->projectLower . '/specs'); $this->exportIgnores[] = 'specs/'; $this->file->put($this->projectLower . '/' . 'phpspec.yml.dist', $content); $this->exportIgnores[] = 'phpspec.yml.dist'; $this->gitIgnores[] = 'phpspec.yml'; }