Imbo\EventListener\Cors::getAllowedOrigins PHP Method

getAllowedOrigins() public method

Returns an array of allowed origins
public getAllowedOrigins ( ) : array
return array The defined allowed origins
    public function getAllowedOrigins()
    {
        return $this->params['allowedOrigins'];
    }

Usage Example

Example #1
0
 /**
  * @covers Imbo\EventListener\Cors::__construct
  * @covers Imbo\EventListener\Cors::getAllowedOrigins
  */
 public function testCleansUpOrigins()
 {
     $listener = new Cors(['allowedOrigins' => ['HTTP://www.rexxars.com:8080/', 'https://IMBO-project.org']]);
     $allowed = $listener->getAllowedOrigins();
     $expected = ['http://www.rexxars.com:8080', 'https://imbo-project.org'];
     foreach ($expected as $e) {
         $this->assertContains($e, $allowed);
     }
     $this->assertCount(2, $allowed);
 }