15
15
use Magento \MagentoCloud \Package \MagentoVersion ;
16
16
use PHPUnit \Framework \MockObject \MockObject ;
17
17
use PHPUnit \Framework \TestCase ;
18
+ use Magento \MagentoCloud \Config \Stage \DeployInterface ;
18
19
19
20
/**
20
21
* @inheritdoc
@@ -60,12 +61,12 @@ protected function setUp(): void
60
61
);
61
62
}
62
63
63
- public function testValidateVersionGreaterTwoDotTwo ()
64
+ public function testValidateVersion ()
64
65
{
65
- $ this ->magentoVersion ->expects ($ this ->once ( ))
66
+ $ this ->magentoVersion ->expects ($ this ->exactly ( 2 ))
66
67
->method ('isGreaterOrEqual ' )
67
- ->with ( '2.2 ' )
68
- ->willReturn ( true );
68
+ ->withConsecutive ([ '2.2 ' ], [ ' 2.4.7 ' ] )
69
+ ->willReturnOnConsecutiveCalls ( true , true );
69
70
$ this ->magentoVersion ->expects ($ this ->once ())
70
71
->method ('satisfies ' )
71
72
->willReturn (true );
@@ -75,32 +76,32 @@ public function testValidateVersionGreaterTwoDotTwo()
75
76
$ this ->assertInstanceOf (Success::class, $ this ->validator ->validate ());
76
77
}
77
78
78
- public function testValidateVersionTwoDotOneAndVariablesNotConfigured ()
79
+ public function testValidateVersionAndVariablesNotConfigured ()
79
80
{
80
- $ this ->magentoVersion ->expects ($ this ->once ( ))
81
+ $ this ->magentoVersion ->expects ($ this ->exactly ( 2 ))
81
82
->method ('isGreaterOrEqual ' )
82
- ->with ( '2.2 ' )
83
- ->willReturn ( false );
83
+ ->withConsecutive ([ '2.2 ' ], [ ' 2.4.7 ' ] )
84
+ ->willReturnOnConsecutiveCalls ( false , false );
84
85
$ this ->magentoVersion ->expects ($ this ->once ())
85
86
->method ('satisfies ' )
86
87
->willReturn (false );
87
- $ this ->configurationCheckerMock ->expects ($ this ->exactly (4 ))
88
+ $ this ->configurationCheckerMock ->expects ($ this ->exactly (6 ))
88
89
->method ('isConfigured ' )
89
90
->willReturn (false );
90
91
91
92
$ this ->assertInstanceOf (Success::class, $ this ->validator ->validate ());
92
93
}
93
94
94
- public function testValidateVersionTwoDotOneAndAllVariablesAreConfigured ()
95
+ public function testValidateVersionAndAllVariablesAreConfigured ()
95
96
{
96
- $ this ->magentoVersion ->expects ($ this ->once ( ))
97
+ $ this ->magentoVersion ->expects ($ this ->exactly ( 2 ))
97
98
->method ('isGreaterOrEqual ' )
98
- ->with ( '2.2 ' )
99
- ->willReturn ( false );
99
+ ->withConsecutive ([ '2.2 ' ], [ ' 2.4.7 ' ] )
100
+ ->willReturnOnConsecutiveCalls ( false , false );
100
101
$ this ->magentoVersion ->expects ($ this ->once ())
101
102
->method ('satisfies ' )
102
103
->willReturn (false );
103
- $ this ->configurationCheckerMock ->expects ($ this ->exactly (4 ))
104
+ $ this ->configurationCheckerMock ->expects ($ this ->exactly (6 ))
104
105
->method ('isConfigured ' )
105
106
->willReturn (true );
106
107
$ this ->resultFactoryMock ->expects ($ this ->once ())
@@ -111,7 +112,9 @@ public function testValidateVersionTwoDotOneAndAllVariablesAreConfigured()
111
112
'CRON_CONSUMERS_RUNNER is available for Magento 2.2.0 and later. ' ,
112
113
'SCD_STRATEGY is available for Magento 2.2.0 and later. ' ,
113
114
'SCD_MAX_EXECUTION_TIME is available for Magento 2.2.0 and later. ' ,
114
- 'GENERATED_CODE_SYMLINK is available for Magento 2.1.x. '
115
+ 'GENERATED_CODE_SYMLINK is available for Magento 2.1.x. ' ,
116
+ 'USE_LUA is available for Magento 2.4.7 and later. ' ,
117
+ 'LUA_KEY is available for Magento 2.4.7 and later. '
115
118
])
116
119
);
117
120
0 commit comments