From 0ee043f745fc53d782528128c615aa24a6af1d24 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sat, 28 Mar 2015 21:45:35 +0100 Subject: Update InstallCommand test They are god damn too long to execute because it launch external command (mostly related to doctrine). So I've added a PHPUnit @group (`command-doctrine`) so that we can avoid launching them on a regular basis, like that: `phpunit --exclude-group command-doctrine` --- .../Tests/Command/InstallCommandTest.php | 15 +++++++++++---- .../CoreBundle/Tests/Mock/InstallCommandMock.php | 22 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 src/Wallabag/CoreBundle/Tests/Mock/InstallCommandMock.php (limited to 'src/Wallabag/CoreBundle/Tests') diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php index 64f6c329..f689b532 100644 --- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php +++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php @@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Tests\Command; use Wallabag\CoreBundle\Tests\WallabagTestCase; use Wallabag\CoreBundle\Command\InstallCommand; +use Wallabag\CoreBundle\Tests\Mock\InstallCommandMock; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Console\Input\ArrayInput; @@ -30,7 +31,7 @@ class InstallCommandTest extends WallabagTestCase $this->container = static::$kernel->getContainer(); $application = new Application(static::$kernel); - $application->add(new InstallCommand()); + $application->add(new InstallCommandMock()); $command = $application->find('wallabag:install'); @@ -64,7 +65,7 @@ class InstallCommandTest extends WallabagTestCase $this->container = static::$kernel->getContainer(); $application = new Application(static::$kernel); - $application->add(new InstallCommand()); + $application->add(new InstallCommandMock()); $command = $application->find('wallabag:install'); @@ -97,6 +98,9 @@ class InstallCommandTest extends WallabagTestCase $this->assertContains('Droping database, creating database and schema', $tester->getDisplay()); } + /** + * @group command-doctrine + */ public function testRunInstallCommandWithDatabaseRemoved() { $this->container = static::$kernel->getContainer(); @@ -148,7 +152,7 @@ class InstallCommandTest extends WallabagTestCase $this->container = static::$kernel->getContainer(); $application = new Application(static::$kernel); - $application->add(new InstallCommand()); + $application->add(new InstallCommandMock()); $command = $application->find('wallabag:install'); @@ -181,6 +185,9 @@ class InstallCommandTest extends WallabagTestCase $this->assertContains('Droping schema and creating schema', $tester->getDisplay()); } + /** + * @group command-doctrine + */ public function testRunInstallCommandChooseNothing() { $this->container = static::$kernel->getContainer(); @@ -242,7 +249,7 @@ class InstallCommandTest extends WallabagTestCase $this->container = static::$kernel->getContainer(); $application = new Application(static::$kernel); - $application->add(new InstallCommand()); + $application->add(new InstallCommandMock()); $command = $application->find('wallabag:install'); diff --git a/src/Wallabag/CoreBundle/Tests/Mock/InstallCommandMock.php b/src/Wallabag/CoreBundle/Tests/Mock/InstallCommandMock.php new file mode 100644 index 00000000..69bc48e0 --- /dev/null +++ b/src/Wallabag/CoreBundle/Tests/Mock/InstallCommandMock.php @@ -0,0 +1,22 @@ +