Add behat help

This commit is contained in:
Nicolas Le Goff
2013-06-11 20:09:30 +02:00
parent b0ede4bb11
commit 5146185517
2 changed files with 43 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ use Alchemy\Phrasea\Core\Version;
use Alchemy\Phrasea\Command\Developer\RegenerateSqliteDb; use Alchemy\Phrasea\Command\Developer\RegenerateSqliteDb;
use Alchemy\Phrasea\Command\Developer\RoutesDumper; use Alchemy\Phrasea\Command\Developer\RoutesDumper;
use Alchemy\Phrasea\Command\Developer\APIRoutesDumper; use Alchemy\Phrasea\Command\Developer\APIRoutesDumper;
use Alchemy\Phrasea\Command\Developer\Behat;
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper; use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
@@ -64,6 +65,7 @@ try {
$cli->command(new RegenerateSqliteDb()); $cli->command(new RegenerateSqliteDb());
$cli->command(new APIRoutesDumper()); $cli->command(new APIRoutesDumper());
$cli->command(new RoutesDumper()); $cli->command(new RoutesDumper());
$cli->command(new Behat());
$cli['console']->addCommands(array( $cli['console']->addCommands(array(
// DBAL Commands // DBAL Commands

View File

@@ -0,0 +1,41 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Developer;
use Alchemy\Phrasea\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Filesystem\Filesystem;
class Behat extends Command
{
public function __construct()
{
parent::__construct('behat:help');
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$fs = new Filesystem();
$output->writeln('To run behat test you must first get selenium :');
$output->writeln('<info>http://selenium.googlecode.com/files/selenium-server-standalone-2.31.0.jar');
$output->writeln('and run it with the following command "java -jar selenium-server-standalone-2.31.0.jar > /dev/null &"');
$output->writeln('Then you must run the following command :');
$relativePath = $fs->makePathRelative(getcwd(), $this->container['root.path'] . '/behat.yml');
$cmd = sprintf('cp %sbehat.yml.dist %sbehat.yml', $relativePath, $relativePath);
$output->writeln('<info>'.$cmd.'</info>');
}
}