AppserverIo\Appserver\Core\ServerNodeConfigurationTest::testGetHandlers PHP Method

testGetHandlers() public method

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