@@ -17,11 +17,12 @@ class RouteTest extends \PHPUnit_Framework_TestCase
17
17
{
18
18
public function testConstructor ()
19
19
{
20
- $ route = new Route ('/{foo} ' , array ('foo ' => 'bar ' ), array ('foo ' => '\d+ ' ), array ('foo ' => 'bar ' ));
20
+ $ route = new Route ('/{foo} ' , array ('foo ' => 'bar ' ), array ('foo ' => '\d+ ' ), array ('foo ' => 'bar ' ), ' {locale}.example.com ' );
21
21
$ this ->assertEquals ('/{foo} ' , $ route ->getPattern (), '__construct() takes a pattern as its first argument ' );
22
22
$ this ->assertEquals (array ('foo ' => 'bar ' ), $ route ->getDefaults (), '__construct() takes defaults as its second argument ' );
23
23
$ this ->assertEquals (array ('foo ' => '\d+ ' ), $ route ->getRequirements (), '__construct() takes requirements as its third argument ' );
24
24
$ this ->assertEquals ('bar ' , $ route ->getOption ('foo ' ), '__construct() takes options as its fourth argument ' );
25
+ $ this ->assertEquals ('{locale}.example.com ' , $ route ->getHostnamePattern (), '__construct() takes a hostname pattern as its fifth argument ' );
25
26
}
26
27
27
28
public function testPattern ()
@@ -116,6 +117,13 @@ public function getInvalidRequirements()
116
117
);
117
118
}
118
119
120
+ public function testHostnamePattern ()
121
+ {
122
+ $ route = new Route ('/ ' );
123
+ $ route ->setHostnamePattern ('{locale}.example.net ' );
124
+ $ this ->assertEquals ('{locale}.example.net ' , $ route ->getHostnamePattern (), '->setHostnamePattern() sets the hostname pattern ' );
125
+ }
126
+
119
127
public function testCompile ()
120
128
{
121
129
$ route = new Route ('/{foo} ' );
0 commit comments