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