77use Composer \DependencyResolver \Operation \UninstallOperation ;
88use Composer \DependencyResolver \Operation \UpdateOperation ;
99use IonBazan \ComposerDiff \Command \DiffCommand ;
10+ use IonBazan \ComposerDiff \Tests \Integration \ComposerApplication ;
1011use IonBazan \ComposerDiff \Tests \TestCase ;
1112use Symfony \Component \Console \Tester \CommandTester ;
1213
@@ -20,7 +21,10 @@ class DiffCommandTest extends TestCase
2021 public function testItGeneratesReportInGivenFormat ($ expectedOutput , array $ options )
2122 {
2223 $ diff = $ this ->getMockBuilder ('IonBazan\ComposerDiff\PackageDiff ' )->getMock ();
23- $ tester = new CommandTester (new DiffCommand ($ diff , array ('gitlab2.org ' )));
24+ $ application = new ComposerApplication ();
25+ $ command = new DiffCommand ($ diff , array ('gitlab2.org ' ));
26+ $ command ->setApplication ($ application );
27+ $ tester = new CommandTester ($ command );
2428 $ diff ->expects ($ this ->once ())
2529 ->method ('getPackageDiff ' )
2630 ->with ($ this ->isType ('string ' ), $ this ->isType ('string ' ), false , false )
@@ -49,7 +53,10 @@ public function testItGeneratesReportInGivenFormat($expectedOutput, array $optio
4953 public function testStrictMode ($ exitCode , array $ prodOperations , array $ devOperations )
5054 {
5155 $ diff = $ this ->getMockBuilder ('IonBazan\ComposerDiff\PackageDiff ' )->getMock ();
52- $ tester = new CommandTester (new DiffCommand ($ diff , array ('gitlab2.org ' )));
56+ $ application = new ComposerApplication ();
57+ $ command = new DiffCommand ($ diff , array ('gitlab2.org ' ));
58+ $ command ->setApplication ($ application );
59+ $ tester = new CommandTester ($ command );
5360 $ diff ->expects ($ this ->exactly (2 ))
5461 ->method ('getPackageDiff ' )
5562 ->with ($ this ->isType ('string ' ), $ this ->isType ('string ' ), $ this ->isType ('boolean ' ), false )
0 commit comments