Skip to content

Commit 49b96b9

Browse files
author
Alex Paliarush
committed
MAGETWO-89542: Eliminate module versions in Git
1 parent 97681ab commit 49b96b9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

dev/tests/static/testsuite/Magento/Test/Integrity/ComposerTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,28 +177,33 @@ private function assertMagentoConventions($dir, $packageType, \StdClass $json)
177177
$this->assertDependsOnFramework($json->require);
178178
$this->assertRequireInSync($json);
179179
$this->assertAutoload($json);
180+
$this->assertNoVersionSpecified($json);
180181
break;
181182
case 'magento2-language':
182183
$this->assertRegExp('/^magento\/language\-[a-z]{2}_([a-z]{4}_)?[a-z]{2}$/', $json->name);
183184
$this->assertDependsOnFramework($json->require);
184185
$this->assertRequireInSync($json);
186+
$this->assertNoVersionSpecified($json);
185187
break;
186188
case 'magento2-theme':
187189
$this->assertRegExp('/^magento\/theme-(?:adminhtml|frontend)(\-[a-z0-9_]+)+$/', $json->name);
188190
$this->assertDependsOnPhp($json->require);
189191
$this->assertPhpVersionInSync($json->name, $json->require->php);
190192
$this->assertDependsOnFramework($json->require);
191193
$this->assertRequireInSync($json);
194+
$this->assertNoVersionSpecified($json);
192195
break;
193196
case 'magento2-library':
194197
$this->assertDependsOnPhp($json->require);
195198
$this->assertRegExp('/^magento\/framework*/', $json->name);
196199
$this->assertPhpVersionInSync($json->name, $json->require->php);
197200
$this->assertRequireInSync($json);
198201
$this->assertAutoload($json);
202+
$this->assertNoVersionSpecified($json);
199203
break;
200204
case 'project':
201205
$this->checkProject();
206+
$this->assertNoVersionSpecified($json);
202207
break;
203208
default:
204209
throw new \InvalidArgumentException("Unknown package type {$packageType}");
@@ -220,6 +225,19 @@ private function assertAutoloadRegistrar(\StdClass $json, $dir)
220225
$this->assertFileExists("$dir/registration.php");
221226
}
222227

228+
/**
229+
* Version must not be specified in the root and package composer JSON files in Git.
230+
*
231+
* All versions are added by tools during release publication by version setter tool.
232+
*
233+
* @param \StdClass $json
234+
*/
235+
private function assertNoVersionSpecified(\StdClass $json)
236+
{
237+
$errorMessage = 'Version must not be specified in the root and package composer JSON files in Git';
238+
$this->assertObjectNotHasAttribute('version', $json, $errorMessage);
239+
}
240+
223241
/**
224242
* Assert that there is PSR-4 autoload in composer json
225243
*

0 commit comments

Comments
 (0)