diff options
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/CoreBundle/WallabagCoreTestCase.php | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php index 816d22f4..50361039 100644 --- a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php +++ b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php | |||
@@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Console\Application; | |||
7 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | 7 | use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; |
8 | use Symfony\Component\BrowserKit\Cookie; | 8 | use Symfony\Component\BrowserKit\Cookie; |
9 | use Symfony\Component\Console\Input\ArrayInput; | 9 | use Symfony\Component\Console\Input\ArrayInput; |
10 | use Symfony\Component\Console\Output\BufferedOutput; | ||
10 | use Symfony\Component\Console\Output\NullOutput; | 11 | use Symfony\Component\Console\Output\NullOutput; |
11 | use Wallabag\CoreBundle\Entity\Config; | 12 | use Wallabag\CoreBundle\Entity\Config; |
12 | use Wallabag\UserBundle\Entity\User; | 13 | use Wallabag\UserBundle\Entity\User; |
@@ -40,24 +41,42 @@ abstract class WallabagCoreTestCase extends WebTestCase | |||
40 | $application = new Application($client->getKernel()); | 41 | $application = new Application($client->getKernel()); |
41 | $application->setAutoExit(false); | 42 | $application->setAutoExit(false); |
42 | 43 | ||
43 | $application->run(new ArrayInput([ | 44 | $output = new BufferedOutput(); |
45 | $exitCode = $application->run(new ArrayInput([ | ||
44 | 'command' => 'doctrine:schema:drop', | 46 | 'command' => 'doctrine:schema:drop', |
45 | '--no-interaction' => true, | 47 | '--no-interaction' => true, |
46 | '--force' => true, | 48 | '--force' => true, |
47 | '--env' => 'test', | 49 | '--env' => 'test', |
48 | ]), new NullOutput()); | 50 | ]), $output); |
49 | 51 | ||
50 | $application->run(new ArrayInput([ | 52 | if (0 !== $exitCode) { |
53 | var_dump('doctrine:schema:drop'); | ||
54 | var_export($output->fetch()); die(); | ||
55 | } | ||
56 | |||
57 | $output = new BufferedOutput(); | ||
58 | $exitCode = $application->run(new ArrayInput([ | ||
51 | 'command' => 'doctrine:schema:create', | 59 | 'command' => 'doctrine:schema:create', |
52 | '--no-interaction' => true, | 60 | '--no-interaction' => true, |
53 | '--env' => 'test', | 61 | '--env' => 'test', |
54 | ]), new NullOutput()); | 62 | ]), $output); |
63 | |||
64 | if (0 !== $exitCode) { | ||
65 | var_dump('doctrine:schema:create'); | ||
66 | var_export($output->fetch()); die(); | ||
67 | } | ||
55 | 68 | ||
56 | $application->run(new ArrayInput([ | 69 | $output = new BufferedOutput(); |
70 | $exitCode = $application->run(new ArrayInput([ | ||
57 | 'command' => 'doctrine:fixtures:load', | 71 | 'command' => 'doctrine:fixtures:load', |
58 | '--no-interaction' => true, | 72 | '--no-interaction' => true, |
59 | '--env' => 'test', | 73 | '--env' => 'test', |
60 | ]), new NullOutput()); | 74 | ]), $output); |
75 | |||
76 | if (0 !== $exitCode) { | ||
77 | var_dump('doctrine:fixtures:load'); | ||
78 | var_export($output->fetch()); die(); | ||
79 | } | ||
61 | 80 | ||
62 | /* | 81 | /* |
63 | * Recreate client to avoid error: | 82 | * Recreate client to avoid error: |