Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding style via PHP_CodeSniffer & assertion call #49

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Exception/InvalidStrategyTypeGiven.php
Expand Up @@ -8,7 +8,6 @@

final class InvalidStrategyTypeGiven extends InvalidArgumentException
{

public static function withType(string $strategyType): self
{
return new self(sprintf('Unknown toggle strategy type %s given.', $strategyType));
Expand Down
12 changes: 6 additions & 6 deletions test/Read/ChainFeatureFinderTest.php
Expand Up @@ -63,7 +63,7 @@ public function testItShouldGetTheFeatureByFeatureIdFromTheFirstFinder(): void

$actual = $chain->get(self::FEATURE_ID);

self::assertSame($expectedFeature, $actual);
$this->assertSame($expectedFeature, $actual);
}

public function testItShouldGetTheFeatureByFeatureIdFromTheSecondFinder(): void
Expand All @@ -89,7 +89,7 @@ public function testItShouldGetTheFeatureByFeatureIdFromTheSecondFinder(): void

$actual = $chain->get(self::FEATURE_ID);

self::assertSame($expectedFeature, $actual);
$this->assertSame($expectedFeature, $actual);
}

public function testItShouldReturnAllFeaturesFromAllFinders(): void
Expand Down Expand Up @@ -125,7 +125,7 @@ public function testItShouldReturnAllFeaturesFromAllFinders(): void

$actual = $chain->all();

self::assertCount(count($expectedFeatures), $actual);
$this->assertCount(count($expectedFeatures), $actual);
}

public function testItShouldReturnAllFeaturesFromAllFindersWithoutRepeatingItems(): void
Expand Down Expand Up @@ -161,7 +161,7 @@ public function testItShouldReturnAllFeaturesFromAllFindersWithoutRepeatingItems

$actual = $chain->all();

self::assertCount(count($expectedFeatures), $actual);
$this->assertCount(count($expectedFeatures), $actual);
}

public function testItShouldReturnAllFeaturesFromAllFindersOrderedByFirstFinderFirst(): void
Expand Down Expand Up @@ -197,7 +197,7 @@ public function testItShouldReturnAllFeaturesFromAllFindersOrderedByFirstFinderF

$actual = $chain->all();

self::assertSame($expectedFeatures, $actual);
$this->assertSame($expectedFeatures, $actual);
}

public function testItShouldReturnAnEmptyArrayIfNoFeaturesFoundInFinders(): void
Expand All @@ -221,6 +221,6 @@ public function testItShouldReturnAnEmptyArrayIfNoFeaturesFoundInFinders(): void

$actual = $chain->all();

self::assertSame([], $actual);
$this->assertSame([], $actual);
}
}
4 changes: 2 additions & 2 deletions test/Read/ChainSegmentFactoryTest.php
Expand Up @@ -42,7 +42,7 @@ public function testItShouldBeCreatedWithAtLeastOneSegmentFactoryInstance(): voi

$current = $chainSegmentFactory->create(self::SEGMENT_ID, self::SEGMENT_TYPE, self::PAYLOAD);

self::assertSame($expectedSegment, $current);
self::assertSame([self::SEGMENT_TYPE], $chainSegmentFactory->types());
$this->assertSame($expectedSegment, $current);
$this->assertSame([self::SEGMENT_TYPE], $chainSegmentFactory->types());
}
}
9 changes: 4 additions & 5 deletions test/Read/ChainToggleStrategyFactoryTest.php
Expand Up @@ -63,8 +63,8 @@ public function testItShouldBeCreatedWithAtLeastOneToggleStrategyFactoryInstance
'segments' => []
]);

self::assertSame($expectedStrategy, $current);
self::assertSame([self::STRATEGY_TYPE], $chainToggleStrategyFactory->types());
$this->assertSame($expectedStrategy, $current);
$this->assertSame([self::STRATEGY_TYPE], $chainToggleStrategyFactory->types());
}

public function testItShouldBeCreatedWithAtLeastOneToggleStrategyFactoryInstanceAndSegments(): void
Expand All @@ -91,8 +91,7 @@ public function testItShouldBeCreatedWithAtLeastOneToggleStrategyFactoryInstance
'segments' => self::SEGMENTS
]);

self::assertSame($expectedStrategy, $current);
self::assertSame([self::STRATEGY_TYPE, 'other_type'], $chainToggleStrategyFactory->types());
$this->assertSame($expectedStrategy, $current);
$this->assertSame([self::STRATEGY_TYPE, 'other_type'], $chainToggleStrategyFactory->types());
}
}