public function testMatchWithAbsoluteAttachmentAndVariables()
{
$request = new Request(array('url' => '/home/index', 'host' => 'bob.amiga.com', 'base' => ''));
Router::attach('app', array('absolute' => true, 'host' => '{:subdomain}.amiga.{:tld}', 'scheme' => 'http', 'prefix' => ''));
Router::scope('app', function () {
Router::connect('/home/index', array('Home::index'));
});
Router::process($request);
$expected = 'http://bob.amiga.com/home/index';
$result = Router::match('/home/index', $request);
$this->assertIdentical($expected, $result);
$expected = 'http://bob.amiga.com/home/index';
$result = Router::match('/home/index', $request, array('scope' => 'app'));
$this->assertIdentical($expected, $result);
$expected = 'http://max.amiga.com/home/index';
$result = Router::match('/home/index', $request, array('scope' => array('subdomain' => 'max')));
$this->assertIdentical($expected, $result);
Router::scope(false);
$result = Router::match('/home/index', $request, array('scope' => array('app' => array('subdomain' => 'max'))));
$this->assertIdentical($expected, $result);
$result = Router::match('/home/index', $request, array('scope' => array('subdomain' => 'max')));
$this->assertNotEqual($expected, $result);
}