Skip to content

Commit

Permalink
Merge pull request #46 from localheinz/fix/rename
Browse files Browse the repository at this point in the history
Fix: Extract method and rename method to make concepts clear
  • Loading branch information
localheinz committed Feb 13, 2018
2 parents 6c0c070 + c534252 commit 67cd1cc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions test/Unit/Normalizer/PackageHashNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,19 +99,22 @@ public function testNormalizeSortsPackageHashIfPropertyExists(string $property):

public function providerProperty(): \Generator
{
$values = [
foreach ($this->propertiesWhereKeysOfHashArePackages() as $value) {
yield $value => [
$value,
];
}
}

private function propertiesWhereKeysOfHashArePackages(): array
{
return [
'conflict',
'provide',
'replace',
'require',
'require-dev',
'suggest',
];

foreach ($values as $value) {
yield $value => [
$value,
];
}
}
}
8 changes: 4 additions & 4 deletions test/Unit/Normalizer/VersionConstraintNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function testNormalizeIgnoresEmptyPackageHash(string $property): void

public function providerProperty(): \Generator
{
$properties = $this->properties();
$properties = $this->propertiesWhereValuesOfHashAreVersionConstraints();

foreach ($properties as $property) {
yield [
Expand Down Expand Up @@ -107,7 +107,7 @@ public function testNormalizeNormalizesVersionConstraints(string $property, stri

public function providerPropertyAndVersionConstraint(): \Generator
{
$properties = $this->properties();
$properties = $this->propertiesWhereValuesOfHashAreVersionConstraints();
$versionConstraints = $this->versionConstraints();

foreach ($properties as $property) {
Expand Down Expand Up @@ -158,7 +158,7 @@ public function providerPropertyAndUntrimmedVersionConstraint(): \Generator
' ',
];

$properties = $this->properties();
$properties = $this->propertiesWhereValuesOfHashAreVersionConstraints();
$versionConstraints = \array_unique(\array_values($this->versionConstraints()));

foreach ($properties as $property) {
Expand All @@ -182,7 +182,7 @@ public function providerPropertyAndUntrimmedVersionConstraint(): \Generator
}
}

private function properties(): array
private function propertiesWhereValuesOfHashAreVersionConstraints(): array
{
return [
'conflict',
Expand Down

0 comments on commit 67cd1cc

Please sign in to comment.