@@ -45,6 +45,60 @@ class SystemPackageTest extends \PHPUnit_Framework_TestCase
45
45
*/
46
46
private $ composer ;
47
47
48
+ /**
49
+ * @var array
50
+ */
51
+ private $ expectedPackages = [
52
+ [
53
+ 'id ' => '1.2.0 ' ,
54
+ 'name ' => 'Version 1.2.0 EE (latest) ' ,
55
+ 'package ' => 'magento/product-enterprise-edition ' ,
56
+ 'stable ' => true
57
+ ],
58
+ [
59
+ 'id ' => '1.2.0 ' ,
60
+ 'name ' => 'Version 1.2.0 CE (latest) ' ,
61
+ 'package ' => 'magento/product-community-edition ' ,
62
+ 'stable ' => true
63
+ ],
64
+ [
65
+ 'id ' => '1.1.0 ' ,
66
+ 'name ' => 'Version 1.1.0 EE ' ,
67
+ 'package ' => 'magento/product-enterprise-edition ' ,
68
+ 'stable ' => true
69
+ ],
70
+ [
71
+ 'id ' => '1.1.0 ' ,
72
+ 'name ' => 'Version 1.1.0 CE ' ,
73
+ 'package ' => 'magento/product-community-edition ' ,
74
+ 'stable ' => true
75
+ ],
76
+ [
77
+ 'id ' => '1.1.0-RC1 ' ,
78
+ 'name ' => 'Version 1.1.0-RC1 EE (unstable version) ' ,
79
+ 'package ' => 'magento/product-enterprise-edition ' ,
80
+ 'stable ' => false
81
+ ],
82
+ [
83
+ 'id ' => '1.1.0-RC1 ' ,
84
+ 'name ' => 'Version 1.1.0-RC1 CE (unstable version) ' ,
85
+ 'package ' => 'magento/product-community-edition ' ,
86
+ 'stable ' => false
87
+ ],
88
+ [
89
+ 'id ' => '1.0.0 ' ,
90
+ 'name ' => 'Version 1.0.0 EE (current) ' ,
91
+ 'package ' => 'magento/product-enterprise-edition ' ,
92
+ 'stable ' => true
93
+ ],
94
+ [
95
+ 'id ' => '1.0.0 ' ,
96
+ 'name ' => 'Version 1.0.0 CE (current) ' ,
97
+ 'package ' => 'magento/product-community-edition ' ,
98
+ 'stable ' => true
99
+ ],
100
+ ];
101
+
48
102
/**
49
103
* @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Framework\Composer\ComposerInformation
50
104
*/
@@ -113,45 +167,6 @@ public function testGetPackageVersions()
113
167
114
168
$ this ->systemPackage = new SystemPackage ($ this ->composerAppFactory , $ this ->composerInformation );
115
169
116
- $ expected = [
117
- [
118
- 'id ' => '1.2.0 ' ,
119
- 'name ' => 'Version 1.2.0 EE (latest) ' ,
120
- 'package ' => 'magento/product-enterprise-edition ' ,
121
- 'stable ' => true
122
- ],
123
- [
124
- 'id ' => '1.2.0 ' ,
125
- 'name ' => 'Version 1.2.0 CE (latest) ' ,
126
- 'package ' => 'magento/product-community-edition ' ,
127
- 'stable ' => true
128
- ],
129
- [
130
- 'id ' => '1.1.0 ' ,
131
- 'name ' => 'Version 1.1.0 EE ' ,
132
- 'package ' => 'magento/product-enterprise-edition ' ,
133
- 'stable ' => true
134
- ],
135
- [
136
- 'id ' => '1.1.0 ' ,
137
- 'name ' => 'Version 1.1.0 CE ' ,
138
- 'package ' => 'magento/product-community-edition ' ,
139
- 'stable ' => true
140
- ],
141
- [
142
- 'id ' => '1.0.0 ' ,
143
- 'name ' => 'Version 1.0.0 EE (current) ' ,
144
- 'package ' => 'magento/product-enterprise-edition ' ,
145
- 'stable ' => true
146
- ],
147
- [
148
- 'id ' => '1.0.0 ' ,
149
- 'name ' => 'Version 1.0.0 CE (current) ' ,
150
- 'package ' => 'magento/product-community-edition ' ,
151
- 'stable ' => true
152
- ],
153
- ];
154
-
155
170
$ this ->infoCommand ->expects ($ this ->at (0 ))
156
171
->method ('run ' )
157
172
->with ('magento/product-community-edition ' )
@@ -160,14 +175,14 @@ public function testGetPackageVersions()
160
175
'name ' => 'magento/product-community-edition ' ,
161
176
'description ' => 'eCommerce Platform for Growth (Enterprise Edition) ' ,
162
177
'keywords ' => '' ,
163
- 'versions ' => '1.2.0, 1.1.0, * 1.0.0 ' ,
178
+ 'versions ' => '1.2.0, 1.1.0, 1.1.0-RC1, * 1.0.0 ' ,
164
179
'type ' => 'metapackage ' ,
165
180
'license ' => 'OSL-3.0, AFL-3.0 ' ,
166
181
'source ' => '[] ' ,
167
182
'names ' => 'magento/product-community-edition ' ,
168
183
'current_version ' => '1.0.0 ' ,
169
- 'available_versions ' => [1 => '1.2.0 ' , 2 => '1.1.0 ' , 3 => '1.0.0 ' ],
170
- 'new_versions ' => ['1.2.0 ' , '1.1.0 ' ]
184
+ 'available_versions ' => [1 => '1.2.0 ' , 2 => '1.1.0 ' , 3 => '1.1.0-RC1 ' , 4 => ' 1. 0.0 ' ],
185
+ 'new_versions ' => ['1.2.0 ' , '1.1.0 ' , ' 1.1.0-RC1 ' ]
171
186
]
172
187
);
173
188
@@ -179,18 +194,17 @@ public function testGetPackageVersions()
179
194
'name ' => 'magento/product-enterprise-edition ' ,
180
195
'description ' => 'eCommerce Platform for Growth (Enterprise Edition) ' ,
181
196
'keywords ' => '' ,
182
- 'versions ' => '1.2.0, 1.1.0, * 1.0.0 ' ,
197
+ 'versions ' => '1.2.0, 1.1.0, 1.1.0-RC1, * 1.0.0 ' ,
183
198
'type ' => 'metapackage ' ,
184
199
'license ' => 'OSL-3.0, AFL-3.0 ' ,
185
200
'source ' => '[] ' ,
186
201
'names ' => 'magento/product-enterprise-edition ' ,
187
202
'current_version ' => '1.0.0 ' ,
188
- 'available_versions ' => [1 => '1.2.0 ' , 2 => '1.1.0 ' , 3 => '1.0.0 ' ],
189
- 'new_versions ' => ['1.2.0 ' , '1.1.0 ' ]
203
+ 'available_versions ' => [1 => '1.2.0 ' , 2 => '1.1.0 ' , 3 => '1.1.0-RC1 ' , 4 => ' 1. 0.0 ' ],
204
+ 'new_versions ' => ['1.2.0 ' , '1.1.0 ' , ' 1.1.0-RC1 ' ]
190
205
]
191
206
);
192
-
193
- $ this ->assertEquals ($ expected , $ this ->systemPackage ->getPackageVersions ());
207
+ $ this ->assertEquals ($ this ->expectedPackages , $ this ->systemPackage ->getPackageVersions ());
194
208
}
195
209
196
210
/**
0 commit comments