22
33namespace IonBazan \ComposerDiff \Tests \Integration ;
44
5- use Composer \Composer ;
6- use Composer \Console \Application ;
75use Composer \Factory ;
8- use Composer \IO \IOInterface ;
96use Composer \IO \NullIO ;
107use Composer \Package \Package ;
118use Composer \Plugin \PluginManager ;
@@ -25,9 +22,8 @@ class DiffCommandTest extends TestCase
2522 */
2623 public function testCommand ($ expectedOutput , array $ input )
2724 {
28- $ application = new ComposerApplication ();
2925 $ command = new DiffCommand (new PackageDiff ());
30- $ command ->setApplication ($ application );
26+ $ command ->setApplication ($ this -> getComposerApplication () );
3127 $ tester = new CommandTester ($ command );
3228 $ result = $ tester ->execute ($ input );
3329 $ this ->assertSame (0 , $ result );
@@ -44,7 +40,7 @@ public function testCommand($expectedOutput, array $input)
4440 public function testComposerApplication ($ expectedOutput , array $ input )
4541 {
4642 $ input = array_merge (array ('command ' => 'diff ' ), $ input );
47- $ app = new ComposerApplication ();
43+ $ app = $ this -> getComposerApplication ();
4844 $ app ->setIO (new NullIO ()); // For Composer v1
4945 $ app ->setAutoExit (false );
5046 $ plugin = $ this ->getPluginPackage ();
@@ -247,16 +243,3 @@ private function getPluginPackage()
247243 return $ plugin ;
248244 }
249245}
250-
251- class ComposerApplication extends Application
252- {
253- public function setIO (IOInterface $ io )
254- {
255- $ this ->io = $ io ;
256- }
257-
258- public function setComposer (Composer $ composer )
259- {
260- $ this ->composer = $ composer ;
261- }
262- }
0 commit comments