1919use JBZoo \ComposerDiff \Comparator ;
2020use JBZoo \ComposerDiff \Diff ;
2121use JBZoo \ComposerDiff \Url ;
22- use JBZoo \ToolboxCI \Commands \Convert ;
23- use JBZoo \ToolboxCI \Commands \ConvertMap ;
2422use JBZoo \Utils \Cli ;
2523use JBZoo \Utils \Sys ;
2624use Symfony \Component \Console \Application ;
2725use Symfony \Component \Console \Input \StringInput ;
2826use Symfony \Component \Console \Output \BufferedOutput ;
27+ use Symfony \Component \Process \Exception \ProcessFailedException ;
2928
3029use function JBZoo \Data \json ;
3130use function JBZoo \Data \phpArray ;
@@ -532,6 +531,27 @@ public function testHelpInReadme()
532531 isContain ("``` \n./vendor/bin/composer-diff --help \n\n{$ helpOutput }\n``` " , $ readmeContent );
533532 }
534533
534+ public function testComparingWithGitVersionPositive ()
535+ {
536+ $ output = $ this ->task ([
537+ 'source ' => 'HEAD:tests/fixtures/testComparingWithGitVersionPositive/composer-from-lock.json ' ,
538+ 'target ' => __DIR__ . '/fixtures/testComparingWithGitVersionPositive/composer-to-lock.json '
539+ ]);
540+
541+ isSame (implode ("\n" , [
542+ 'There is no difference (require) ' ,
543+ 'There is no difference (require-dev) '
544+ ]), trim ($ output ));
545+ }
546+
547+ public function testComparingWithGitVersionNegative ()
548+ {
549+ $ this ->expectException (ProcessFailedException::class);
550+
551+ // File not found in git!
552+ $ this ->taskReal (['source ' => 'HEAD:invalid_path/composer.lock ' ]);
553+ }
554+
535555 #### Testing Tools /////////////////////////////////////////////////////////////////////////////////////////////////
536556
537557 /**
@@ -554,7 +574,7 @@ private function toArray(array $fullDiff)
554574 }
555575
556576 /**
557- * @param array $params
577+ * @param array $params
558578 * @return string
559579 * @throws \Exception
560580 */
0 commit comments