@@ -50,7 +50,6 @@ class SystemPackageTest extends \PHPUnit_Framework_TestCase
50
50
*/
51
51
private $ composerInformation ;
52
52
53
-
54
53
public function setUp ()
55
54
{
56
55
$ this ->composerAppFactory = $ this ->getMock (
@@ -176,6 +175,35 @@ public function testGetPackageVersions()
176
175
$ this ->assertEquals ($ expected , $ this ->systemPackage ->getPackageVersions ());
177
176
}
178
177
178
+ /**
179
+ * @expectedException \RuntimeException
180
+ * @expectedExceptionMessage System packages not found
181
+ */
182
+ public function testGetPackageVersionGitCloned ()
183
+ {
184
+ $ package = $ this ->getMock ('\Composer\Package\Package ' , [], [], '' , false );
185
+ $ this ->repository
186
+ ->expects ($ this ->once ())
187
+ ->method ('getPackages ' )
188
+ ->willReturn ([$ package ]);
189
+
190
+ $ this ->locker ->expects ($ this ->once ())->method ('getLockedRepository ' )->willReturn ($ this ->repository );
191
+ $ this ->composerInformation ->expects ($ this ->any ())->method ('isSystemPackage ' )->willReturn (false );
192
+ $ this ->composer ->expects ($ this ->once ())->method ('getLocker ' )->willReturn ($ this ->locker );
193
+ $ this ->magentoComposerApp ->expects ($ this ->once ())->method ('createComposer ' )->willReturn ($ this ->composer );
194
+
195
+ $ this ->composerAppFactory ->expects ($ this ->once ())
196
+ ->method ('create ' )
197
+ ->willReturn ($ this ->magentoComposerApp );
198
+
199
+ $ this ->composerAppFactory ->expects ($ this ->once ())
200
+ ->method ('createInfoCommand ' )
201
+ ->willReturn ($ this ->infoCommand );
202
+
203
+ $ this ->systemPackage = new SystemPackage ($ this ->composerAppFactory , $ this ->composerInformation );
204
+ $ this ->systemPackage ->getPackageVersions ();
205
+ }
206
+
179
207
/**
180
208
* @expectedException \RuntimeException
181
209
* @expectedExceptionMessage System package not found
0 commit comments