X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FTests%2FCommand%2FInstallCommandTest.php;h=e98dd20260ae0c32c2295a8d8f94aea97b52af5a;hb=78507d28357b132237ad35ecdf0704d1ca56dfaa;hp=24910e605d603f36b0dc4e432aec9eb8c18e50bd;hpb=872384b0c18a4c39d7d996e600b25a8568fa6963;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php index 24910e60..e98dd202 100644 --- a/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php +++ b/src/Wallabag/CoreBundle/Tests/Command/InstallCommandTest.php @@ -35,19 +35,16 @@ class InstallCommandTest extends WallabagCoreTestCase $command = $application->find('wallabag:install'); - // We mock the DialogHelper - $dialog = $this->getMockBuilder('Symfony\Component\Console\Helper\DialogHelper') + // We mock the QuestionHelper + $question = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper') ->disableOriginalConstructor() ->getMock(); - $dialog->expects($this->any()) + $question->expects($this->any()) ->method('ask') - ->will($this->returnValue('test_'.uniqid('', true))); - $dialog->expects($this->any()) - ->method('askConfirmation') - ->will($this->returnValue(true)); + ->will($this->returnValue('yes_'.uniqid('', true))); // We override the standard helper with our mock - $command->getHelperSet()->set($dialog, 'dialog'); + $command->getHelperSet()->set($question, 'question'); $tester = new CommandTester($command); $tester->execute(array( @@ -69,19 +66,16 @@ class InstallCommandTest extends WallabagCoreTestCase $command = $application->find('wallabag:install'); - // We mock the DialogHelper - $dialog = $this->getMockBuilder('Symfony\Component\Console\Helper\DialogHelper') + // We mock the QuestionHelper + $question = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper') ->disableOriginalConstructor() ->getMock(); - $dialog->expects($this->any()) + $question->expects($this->any()) ->method('ask') - ->will($this->returnValue('test_'.uniqid('', true))); - $dialog->expects($this->any()) - ->method('askConfirmation') - ->will($this->returnValue(true)); + ->will($this->returnValue('yes_'.uniqid('', true))); // We override the standard helper with our mock - $command->getHelperSet()->set($dialog, 'dialog'); + $command->getHelperSet()->set($question, 'question'); $tester = new CommandTester($command); $tester->execute(array( @@ -119,19 +113,16 @@ class InstallCommandTest extends WallabagCoreTestCase $command = $application->find('wallabag:install'); - // We mock the DialogHelper - $dialog = $this->getMockBuilder('Symfony\Component\Console\Helper\DialogHelper') + // We mock the QuestionHelper + $question = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper') ->disableOriginalConstructor() ->getMock(); - $dialog->expects($this->any()) + $question->expects($this->any()) ->method('ask') - ->will($this->returnValue('test_'.uniqid('', true))); - $dialog->expects($this->any()) - ->method('askConfirmation') - ->will($this->returnValue(true)); + ->will($this->returnValue('yes_'.uniqid('', true))); // We override the standard helper with our mock - $command->getHelperSet()->set($dialog, 'dialog'); + $command->getHelperSet()->set($question, 'question'); $tester = new CommandTester($command); $tester->execute(array( @@ -156,13 +147,13 @@ class InstallCommandTest extends WallabagCoreTestCase $command = $application->find('wallabag:install'); - // We mock the DialogHelper - $dialog = $this->getMockBuilder('Symfony\Component\Console\Helper\DialogHelper') + // We mock the QuestionHelper + $question = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper') ->disableOriginalConstructor() ->getMock(); - $dialog->expects($this->exactly(3)) - ->method('askConfirmation') + $question->expects($this->exactly(3)) + ->method('ask') ->will($this->onConsecutiveCalls( false, // don't want to reset the entire database true, // do want to reset the schema @@ -170,7 +161,7 @@ class InstallCommandTest extends WallabagCoreTestCase )); // We override the standard helper with our mock - $command->getHelperSet()->set($dialog, 'dialog'); + $command->getHelperSet()->set($question, 'question'); $tester = new CommandTester($command); $tester->execute(array( @@ -216,20 +207,20 @@ class InstallCommandTest extends WallabagCoreTestCase $command = $application->find('wallabag:install'); - // We mock the DialogHelper - $dialog = $this->getMockBuilder('Symfony\Component\Console\Helper\DialogHelper') + // We mock the QuestionHelper + $question = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper') ->disableOriginalConstructor() ->getMock(); - $dialog->expects($this->exactly(2)) - ->method('askConfirmation') + $question->expects($this->exactly(2)) + ->method('ask') ->will($this->onConsecutiveCalls( false, // don't want to reset the entire database false // don't want to create a new user )); // We override the standard helper with our mock - $command->getHelperSet()->set($dialog, 'dialog'); + $command->getHelperSet()->set($question, 'question'); $tester = new CommandTester($command); $tester->execute(array( @@ -253,19 +244,16 @@ class InstallCommandTest extends WallabagCoreTestCase $command = $application->find('wallabag:install'); - // We mock the DialogHelper - $dialog = $this->getMockBuilder('Symfony\Component\Console\Helper\DialogHelper') + // We mock the QuestionHelper + $question = $this->getMockBuilder('Symfony\Component\Console\Helper\QuestionHelper') ->disableOriginalConstructor() ->getMock(); - $dialog->expects($this->any()) + $question->expects($this->any()) ->method('ask') - ->will($this->returnValue('test_'.uniqid('', true))); - $dialog->expects($this->any()) - ->method('askConfirmation') - ->will($this->returnValue(true)); + ->will($this->returnValue('yes_'.uniqid('', true))); // We override the standard helper with our mock - $command->getHelperSet()->set($dialog, 'dialog'); + $command->getHelperSet()->set($question, 'question'); $tester = new CommandTester($command); $tester->execute(array(