first commit
This commit is contained in:
31
bundles/KupShop/DevelopmentBundle/Command/ResetTestDB.php
Normal file
31
bundles/KupShop/DevelopmentBundle/Command/ResetTestDB.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace KupShop\DevelopmentBundle\Command;
|
||||
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class ResetTestDB extends Command
|
||||
{
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('kupshop:tests:reset')
|
||||
->setDescription('Reset testing databases');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$output->writeln('Deleting databases...');
|
||||
|
||||
sqlQuery('DROP DATABASE IF EXISTS phpunit_test');
|
||||
sqlQuery('DROP DATABASE IF EXISTS phpunit_test_shop');
|
||||
|
||||
$output->writeln('Creating databases...');
|
||||
sqlQuery('CREATE DATABASE phpunit_test');
|
||||
sqlQuery('CREATE DATABASE phpunit_test_shop');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user