/** * Execute the console command. * * @return mixed */ public function handle() { $file = $this->getFileName(); $path = $this->getPath(); $filePath = $this->getFilePath(); $eol = PHP_EOL; $this->generator->makeGitIgnore($file, $path); if (file_exists($this->getFilePath())) { $this->error(PHP_EOL . 'Wordpress is already down.' . PHP_EOL); } else { $this->generator->makeMaintenanceFile($filePath); $this->info("{$eol}Wordpress set to maintenance mode. Either run \"artisan wp:up\" to {$eol} bring the site back up or manually delete {$eol} {$filePath}."); } }
/** * @test */ public function it_has_the_same_content_as_the_maintenance_template() { $filename = '.' . $this->faker->uuid; $dir = time(); $this->artisan('wp:down', ['--file' => $filename, '--dir' => $dir]); $this->assertSame(file_get_contents($this->getPublicPath() . '/' . $dir . '/' . $filename), \Pbc\WordpressArtisan\Commands\Wordpress\Maintenance\Generate::getTemplateContent()); }