function it_should_be_able_to_fetch_features_passed_by_constructor(FeatureInterface $featureOne, FeatureInterface $featureTwo) { $featureOne->getName()->willReturn('feature-one')->shouldBeCalled(); $featureTwo->getName()->willReturn('feature-two')->shouldBeCalled(); $this->beConstructedWith([$featureOne, $featureTwo]); $this->fetchFeature('feature-one')->shouldReturn($featureOne); $this->fetchFeature('feature-two')->shouldReturn($featureTwo); }
/** * @param FeatureInterface $feature * @return bool */ public function hasFeature(FeatureInterface $feature) { return null !== $this->getDataProvider()->fetchFeature($feature->getName()); }
/** * @param FeatureInterface $feature * @return $this */ public function addFeature(FeatureInterface $feature) { $this->features[$feature->getName()] = $feature; return $this; }