AppserverIo\Appserver\Core\ServerNodeConfiguration::getRewrites PHP Method

getRewrites() public method

Returns the rewrite configuration.
public getRewrites ( ) : array
return array
    public function getRewrites()
    {
        return $this->rewrites;
    }

Usage Example

 /**
  * Checks whether the getRewrites() method returns the expected result.
  *
  * @return void
  * @todo
  */
 public function testGetRewrites()
 {
     // initialize the array with expected result
     $rewrites = json_decode(file_get_contents(__DIR__ . '/Api/Node/_files/prepareRewrites.json'));
     // create a mock configuration instance
     $mockNode = $this->getMock('AppserverIo\\Appserver\\Core\\Api\\Node\\ServerNode', array('getRewritesAsArray'));
     $mockNode->expects($this->once())->method('getRewritesAsArray')->will($this->returnValue($rewrites));
     // initialize the server node
     $serverNode = new ServerNodeConfiguration($mockNode);
     // check the array with the rewrites data
     $this->assertSame($rewrites, $serverNode->getRewrites());
 }