/** * @param $rule * @param $return * @param $expectException * * @dataProvider provideForGetFilter */ public function testGetFilterForRule($rule, $return, $expectException) { if ($expectException) { $this->setExpectedException('\\UnexpectedValueException'); } $this->assertEquals($return, $this->loader->getFilterForRule($rule)); }
/** * Attempts to load Filter from Container or hands off to parent loader. * * @param Rule $rule * @return BaseFilter */ public function getFilterForRule(Rule $rule) { $filterIdentifier = $rule->getFilter(); if ($this->container === null || !$this->container->has($filterIdentifier)) { return parent::getFilterForRule($rule); } return $this->container->get($filterIdentifier); }