12 use MediaWikiCoversValidator;
13 use PHPUnit4And6Compat;
21 $this->setExpectedException( InvalidArgumentException::class );
22 $normalizer->normalizeSuffix( $nonString );
47 $normalizer->normalizeSuffix( $version )
57 [
'123.321.456.654' ],
65 $withoutDash, $withDash
71 $normalizer->normalizeSuffix( $withoutDash )
77 [
'1.22.0alpha',
'1.22.0-alpha' ],
78 [
'1.22.0RC',
'1.22.0-RC' ],
79 [
'1.19beta',
'1.19-beta' ],
80 [
'1.9RC4',
'1.9-RC4' ],
81 [
'1.9.1.2RC4',
'1.9.1.2-RC4' ],
82 [
'1.9.1.2RC',
'1.9.1.2-RC' ],
83 [
'123.321.456.654RC9001',
'123.321.456.654-RC9001' ],
91 $withoutDash, $withDash
104 $normalizer->normalizeLevelCount( $version )
114 [
'123.321.456.654' ],
115 [
'123.321.456.654RC4' ],
116 [
'123.321.456.654-RC4' ],
130 $normalizer->normalizeLevelCount( $version )
136 [
'1.22.0.0',
'1.22' ],
137 [
'1.22.0.0',
'1.22.0' ],
138 [
'1.19.2.0',
'1.19.2' ],
139 [
'12345.0.0.0',
'12345' ],
140 [
'12345.0.0.0-RC4',
'12345-RC4' ],
141 [
'12345.0.0.0-alpha',
'12345-alpha' ],
ComposerVersionNormalizer.
testGivenInvalidVersion_normalizeSuffixReturnsAsIs( $invalidVersion)
invalidVersionProvider
assertRemainsUnchanged( $version)
testGivenComplexVersionWithoutDash_normalizeSuffixAddsDash( $withoutDash, $withDash)
complexVersionProvider
testGivenSimpleVersion_normalizeSuffixReturnsAsIs( $simpleVersion)
simpleVersionProvider
fourLevelVersionsProvider()
testGivenFewerLevels_levelCountNormalizationEnsuresFourLevels( $expected, $version)
levelNormalizationProvider
testGivenNonString_normalizeThrowsInvalidArgumentException( $nonString)
nonStringProvider
levelNormalizationProvider()
testGivenFourLevels_levelCountNormalizationDoesNothing( $version)
fourLevelVersionsProvider
testGivenComplexVersionWithDash_normalizeSuffixReturnsAsIs( $withoutDash, $withDash)
complexVersionProvider
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true