/** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $filters = new \Expose\FilterCollection(); $filters->load(); $logger = App::make('log'); $manager = new \Expose\Manager($filters, $logger); $manager->run($request->input()); Log::info(sprintf("Logging results from Expose %d", $manager->getImpact())); return $next($request); }
/** * Test that a field marked as an exception based on a regex wildcard is ignored * * @covers \Expose\Manager::setException * @covers \Expose\Manager::run */ public function testExceptionWildcardIsIgnored() { $filterCollection = new \Expose\FilterCollection(); $filterCollection->setFilterData($this->sampleFilters); $logger = new MockLogger(); $manager = new \Expose\Manager($filterCollection, $logger); $manager->setConfig(array('test' => 'foo')); $manager->setException('POST.foo[0-9]+'); $data = array('POST' => array('foo1234' => 'testmatch1')); $manager->run($data); $this->assertEquals($manager->getImpact(), 0); }