@@ -596,24 +596,16 @@ function ($args) use ($that, $io) {
596596
597597 $ config = new Config ();
598598 $ mockIO = $ io ->reveal ();
599- if (version_compare ('2.0.0 ' , PluginInterface::PLUGIN_API_VERSION , '> ' )) {
600- return new VcsRepository (
601- $ args [1 ],
602- $ mockIO ,
603- $ config
604- );
605- } else {
606- $ httpDownloader = new HttpDownloader (
607- $ mockIO ,
608- $ config
609- );
610- return new VcsRepository (
611- $ args [1 ],
612- $ mockIO ,
613- $ config ,
614- $ httpDownloader
615- );
616- }
599+ $ httpDownloader = new HttpDownloader (
600+ $ mockIO ,
601+ $ config
602+ );
603+ return new VcsRepository (
604+ $ args [1 ],
605+ $ mockIO ,
606+ $ config ,
607+ $ httpDownloader
608+ );
617609 }
618610 );
619611 $ repoManager ->prependRepository (Argument::any ())->will (
@@ -688,25 +680,17 @@ function ($args) use ($that, $io) {
688680
689681 $ config = new Config ();
690682 $ mockIO = $ io ->reveal ();
691- if (version_compare ('2.0.0 ' , PluginInterface::PLUGIN_API_VERSION , '> ' )) {
692- return new VcsRepository (
693- $ args [1 ],
694- $ mockIO ,
695- $ config
696- );
697- } else {
698- $ httpDownloader = new HttpDownloader (
699- $ mockIO ,
700- $ config
701- );
702-
703- return new VcsRepository (
704- $ args [1 ],
705- $ mockIO ,
706- $ config ,
707- $ httpDownloader
708- );
709- }
683+ $ httpDownloader = new HttpDownloader (
684+ $ mockIO ,
685+ $ config
686+ );
687+
688+ return new VcsRepository (
689+ $ args [1 ],
690+ $ mockIO ,
691+ $ config ,
692+ $ httpDownloader
693+ );
710694 }
711695 );
712696 $ repoManager ->prependRepository (Argument::any ())->will (
@@ -1252,13 +1236,6 @@ public function testHasBranchAlias($fireInit)
12521236 $ io = $ this ->io ;
12531237 $ dir = $ this ->fixtureDir (__FUNCTION__ );
12541238
1255- // RootAliasPackage was updated in 06c44ce to include more setters
1256- // that we take advantage of if available
1257- $ haveComposerWithCompleteRootAlias = method_exists (
1258- RootPackageInterface::class,
1259- 'setRepositories '
1260- );
1261-
12621239 $ repoManager = $ this ->prophesize (
12631240 RepositoryManager::class
12641241 );
@@ -1268,25 +1245,17 @@ public function testHasBranchAlias($fireInit)
12681245 )->will (function ($ args ) use ($ io ) {
12691246 $ config = new Config ();
12701247 $ mockIO = $ io ->reveal ();
1271- if (version_compare ('2.0.0 ' , PluginInterface::PLUGIN_API_VERSION , '> ' )) {
1272- return new VcsRepository (
1273- $ args [1 ],
1274- $ mockIO ,
1275- $ config
1276- );
1277- } else {
1278- $ httpDownloader = new HttpDownloader (
1279- $ mockIO ,
1280- $ config
1281- );
1248+ $ httpDownloader = new HttpDownloader (
1249+ $ mockIO ,
1250+ $ config
1251+ );
12821252
1283- return new VcsRepository (
1284- $ args [1 ],
1285- $ mockIO ,
1286- $ config ,
1287- $ httpDownloader
1288- );
1289- }
1253+ return new VcsRepository (
1254+ $ args [1 ],
1255+ $ mockIO ,
1256+ $ config ,
1257+ $ httpDownloader
1258+ );
12901259 });
12911260 $ repoManager ->prependRepository (Argument::any ())->shouldBeCalled ();
12921261 $ this ->composer ->getRepositoryManager ()->will (
@@ -1306,29 +1275,14 @@ function () use ($repoManager) {
13061275 $ alias ->setDevRequires (Argument::type ('array ' ))->shouldBeCalled ();
13071276 $ alias ->setRequires (Argument::type ('array ' ))->shouldBeCalled ();
13081277
1309- if ($ haveComposerWithCompleteRootAlias ) {
1310- // When Composer supports it we will apply our changes directly to
1311- // the RootAliasPackage
1312- $ alias ->setAutoload (Argument::type ('array ' ))->shouldBeCalled ();
1313- $ alias ->setConflicts (Argument::type ('array ' ))->shouldBeCalled ();
1314- $ alias ->setDevAutoload (Argument::type ('array ' ))->shouldBeCalled ();
1315- $ alias ->setProvides (Argument::type ('array ' ))->shouldBeCalled ();
1316- $ alias ->setReplaces (Argument::type ('array ' ))->shouldBeCalled ();
1317- $ alias ->setRepositories (Argument::type ('array ' ))->shouldBeCalled ();
1318- $ alias ->setStabilityFlags (Argument::type ('array ' ))->shouldBeCalled ();
1319- $ alias ->setSuggests (Argument::type ('array ' ))->shouldBeCalled ();
1320- } else {
1321- // With older versions of Composer we will fall back to unwrapping
1322- // the aliased RootPackage and make calls to it
1323- $ root ->setAutoload (Argument::type ('array ' ))->shouldBeCalled ();
1324- $ root ->setConflicts (Argument::type ('array ' ))->shouldBeCalled ();
1325- $ root ->setDevAutoload (Argument::type ('array ' ))->shouldBeCalled ();
1326- $ root ->setProvides (Argument::type ('array ' ))->shouldBeCalled ();
1327- $ root ->setReplaces (Argument::type ('array ' ))->shouldBeCalled ();
1328- $ root ->setRepositories (Argument::type ('array ' ))->shouldBeCalled ();
1329- $ root ->setSuggests (Argument::type ('array ' ))->shouldBeCalled ();
1330- $ alias ->getAliasOf ()->shouldBeCalled ();
1331- }
1278+ $ alias ->setAutoload (Argument::type ('array ' ))->shouldBeCalled ();
1279+ $ alias ->setConflicts (Argument::type ('array ' ))->shouldBeCalled ();
1280+ $ alias ->setDevAutoload (Argument::type ('array ' ))->shouldBeCalled ();
1281+ $ alias ->setProvides (Argument::type ('array ' ))->shouldBeCalled ();
1282+ $ alias ->setReplaces (Argument::type ('array ' ))->shouldBeCalled ();
1283+ $ alias ->setRepositories (Argument::type ('array ' ))->shouldBeCalled ();
1284+ $ alias ->setStabilityFlags (Argument::type ('array ' ))->shouldBeCalled ();
1285+ $ alias ->setSuggests (Argument::type ('array ' ))->shouldBeCalled ();
13321286
13331287 $ alias = $ alias ->reveal ();
13341288
0 commit comments