@@ -17,11 +17,12 @@ class RouteTest extends \PHPUnit_Framework_TestCase
1717{
1818 public function testConstructor ()
1919 {
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 ' );
2121 $ this ->assertEquals ('/{foo} ' , $ route ->getPattern (), '__construct() takes a pattern as its first argument ' );
2222 $ this ->assertEquals (array ('foo ' => 'bar ' ), $ route ->getDefaults (), '__construct() takes defaults as its second argument ' );
2323 $ this ->assertEquals (array ('foo ' => '\d+ ' ), $ route ->getRequirements (), '__construct() takes requirements as its third argument ' );
2424 $ 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 ' );
2526 }
2627
2728 public function testPattern ()
@@ -116,6 +117,13 @@ public function getInvalidRequirements()
116117 );
117118 }
118119
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+
119127 public function testCompile ()
120128 {
121129 $ route = new Route ('/{foo} ' );
0 commit comments