From 32fc0b124cc5fbba3e87941dddfed0012bc86557 Mon Sep 17 00:00:00 2001 From: Aydin Hassan Date: Thu, 28 Jan 2016 08:27:40 +0000 Subject: [PATCH] Run composer install when running an exercise --- src/Factory/EventDispatcherFactory.php | 4 +++- test/Factory/EventDispatcherFactoryTest.php | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/Factory/EventDispatcherFactory.php b/src/Factory/EventDispatcherFactory.php index 9f763a07..b713eea4 100644 --- a/src/Factory/EventDispatcherFactory.php +++ b/src/Factory/EventDispatcherFactory.php @@ -25,7 +25,9 @@ public function __invoke(ContainerInterface $container) { $dispatcher = new EventDispatcher($container->get(ResultAggregator::class)); - $dispatcher->listen('verify.start', $container->get(PrepareSolutionListener::class)); + $prepareSolutionListener = $container->get(PrepareSolutionListener::class); + $dispatcher->listen('verify.start', $prepareSolutionListener); + $dispatcher->listen('run.start', $prepareSolutionListener); $codePatcherListener = $container->get(CodePatchListener::class); $dispatcher->listen('verify.pre.execute', [$codePatcherListener, 'patch']); diff --git a/test/Factory/EventDispatcherFactoryTest.php b/test/Factory/EventDispatcherFactoryTest.php index 1a4429a3..aba9b167 100644 --- a/test/Factory/EventDispatcherFactoryTest.php +++ b/test/Factory/EventDispatcherFactoryTest.php @@ -58,15 +58,16 @@ public function testCreate() 'verify.start' => [ $prepareSolutionListener ], + 'run.start' => [ + $prepareSolutionListener, + [$codePatchListener, 'patch'], + ], 'verify.pre.execute' => [ [$codePatchListener, 'patch'], ], 'verify.post.execute' => [ [$codePatchListener, 'revert'], ], - 'run.start' => [ - [$codePatchListener, 'patch'], - ], 'run.finish' => [ [$codePatchListener, 'revert'], ],