/**
* Validates the location node when inititalized from
* the example file.
*
* @return void
*/
public function validateWithUuids()
{
// check the UUID and condition
$this->assertSame('a47ac10b-58cc-4372-a567-0e02b2c3d479', $this->location->getUuid());
$this->assertSame('^test\\/.*\\.php', $this->location->getCondition());
// load the file handlers
$fileHandlers = $this->location->getFileHandlers();
// asser that we've exactly one file handler
$this->assertCount(1, $fileHandlers);
// values to compare
$paramsToCompare = array('host' => array('uuid' => 'c47ac10b-4372- 58cc-a567-0e02b2c3d479', 'type' => 'string', 'value' => '127.0.0.1'), 'port' => array('uuid' => 'd47ac10b-4372- 58cc-a567-0e02b2c3d479', 'type' => 'integer', 'value' => 9000));
// check the file handlers values
foreach ($fileHandlers as $fileHandler) {
// compare the file handler values
$this->assertSame('b47ac10b-4372- 58cc-a567-0e02b2c3d479', $fileHandler->getUuid());
$this->assertSame('hhvm', $fileHandler->getName());
$this->assertSame('.php', $fileHandler->getExtension());
// compare the params
foreach ($fileHandler->getParams() as $param) {
$this->assertSame($paramsToCompare[$param->getName()]['uuid'], $param->getUuid());
$this->assertSame($paramsToCompare[$param->getName()]['type'], $param->getType());
$this->assertSame($paramsToCompare[$param->getName()]['value'], $param->castToType());
}
}
}