public function classSetUp() { $this->filter = new FilterChain(); $this->filter->andFilter(new CompositeFilter([new GetFilter(), new HasFilter(), new IsFilter()], CompositeFilter::TYPE_OR)); $this->filter->andFilter(new OptionalParametersFilter()); $this->object = new CompositeFilterObject(); }
/** * Constructor */ public function __construct() { parent::__construct(); $this->filterChain = new FilterChain(); $this->filterChain->andFilter(new CompositeFilter([new GetFilter(), new IsFilter(), new HasFilter()], CompositeFilter::TYPE_OR)); $this->filterChain->andFilter(new OptionalParametersFilter()); }
public function testAndFilter() { $filterContainer = new FilterChain(); $filterContainer->andFilter(new ExcludeMethodsFilter(['getBar', 'getBaz'])); $filterContainer->andFilter(new GetFilter()); $this->assertFalse($filterContainer->accept('getBar'), 'Rejected because of the ExcludeMethods'); $this->assertFalse($filterContainer->accept('isFoo'), 'Rejected because of the GetFilter'); $this->assertTrue($filterContainer->accept('getFoo')); }