File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 12
12
use Composer \Package \RootPackageInterface ;
13
13
use Composer \Repository \RepositoryManager ;
14
14
use Composer \Repository \WritableRepositoryInterface ;
15
+ use Composer \Repository \InstalledRepositoryInterface ;
15
16
use Magento \CloudPatches \Composer \MagentoVersion ;
16
17
use PHPUnit \Framework \MockObject \MockObject ;
17
18
use PHPUnit \Framework \TestCase ;
@@ -24,7 +25,7 @@ class MagentoVersionTest extends TestCase
24
25
const VERSION = '2.3.5 ' ;
25
26
26
27
/**
27
- * @var WritableRepositoryInterface|MockObject
28
+ * @var WritableRepositoryInterface|InstalledRepositoryInterface| MockObject
28
29
*/
29
30
private $ repository ;
30
31
@@ -43,7 +44,11 @@ class MagentoVersionTest extends TestCase
43
44
*/
44
45
protected function setUp (): void
45
46
{
46
- $ this ->repository = $ this ->getMockForAbstractClass (WritableRepositoryInterface::class);
47
+ $ this ->repository = $ this ->getMockForAbstractClass (
48
+ (version_compare (PHP_VERSION , '7.3 ' ) == -1 )
49
+ ? WritableRepositoryInterface::class
50
+ : InstalledRepositoryInterface::class
51
+ );
47
52
$ this ->rootPackage = $ this ->getMockForAbstractClass (RootPackageInterface::class);
48
53
$ repositoryManager = $ this ->createMock (RepositoryManager::class);
49
54
$ repositoryManager ->method ('getLocalRepository ' )
You can’t perform that action at this time.
0 commit comments