7
7
use Composer \DependencyResolver \Operation \UninstallOperation ;
8
8
use Composer \DependencyResolver \Operation \UpdateOperation ;
9
9
use IonBazan \ComposerDiff \Command \DiffCommand ;
10
+ use IonBazan \ComposerDiff \Tests \Integration \ComposerApplication ;
10
11
use IonBazan \ComposerDiff \Tests \TestCase ;
11
12
use Symfony \Component \Console \Tester \CommandTester ;
12
13
@@ -20,7 +21,10 @@ class DiffCommandTest extends TestCase
20
21
public function testItGeneratesReportInGivenFormat ($ expectedOutput , array $ options )
21
22
{
22
23
$ 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 );
24
28
$ diff ->expects ($ this ->once ())
25
29
->method ('getPackageDiff ' )
26
30
->with ($ this ->isType ('string ' ), $ this ->isType ('string ' ), false , false )
@@ -49,7 +53,10 @@ public function testItGeneratesReportInGivenFormat($expectedOutput, array $optio
49
53
public function testStrictMode ($ exitCode , array $ prodOperations , array $ devOperations )
50
54
{
51
55
$ 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 );
53
60
$ diff ->expects ($ this ->exactly (2 ))
54
61
->method ('getPackageDiff ' )
55
62
->with ($ this ->isType ('string ' ), $ this ->isType ('string ' ), $ this ->isType ('boolean ' ), false )
0 commit comments