public function testIsRequestAllowed() { $this->service = new CorsService(); $this->request = new Request(); $this->specify('request is not allowed', function () { $this->request->headers->set('Origin', 'http://foo.com'); verify($this->service->isRequestAllowed($this->request))->false(); }); $this->service = new CorsService(['allowOrigins' => ['http://foo.com']]); $this->specify('request is allowed', function () { $this->request->headers->set('Origin', 'http://foo.com'); verify($this->service->isRequestAllowed($this->request))->true(); }); }