Skip to content

Commit

Permalink
[#4] Update InMemoryFeatureRepository::remove contract with a Feature…
Browse files Browse the repository at this point in the history
… instead of FeatureId
  • Loading branch information
xserrat committed Oct 8, 2021
1 parent ffe3c26 commit aa01df1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/InMemoryFeatureRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ public function save(Feature $feature): void
$this->features[$feature->id()] = $feature;
}

public function remove(FeatureId $featureId): void
public function remove(Feature $feature): void
{
unset($this->features[$featureId->value()]);
unset($this->features[$feature->id()]);
}

public function get(FeatureId $featureId): Feature
Expand Down
2 changes: 1 addition & 1 deletion test/InMemoryFeatureRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testItShouldRemoveSavedFeatureAtInMemoryRepository(): void
$repository = new InMemoryFeatureRepository();
$repository->save($feature);
self::assertSame($feature, $repository->get($featureId));
$repository->remove($featureId);
$repository->remove($feature);
$repository->get($featureId);
}
}

0 comments on commit aa01df1

Please sign in to comment.