2
0

ChainTest.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <?php
  2. /**
  3. * @category Zend
  4. * @package Zend_Controller
  5. * @subpackage UnitTests
  6. */
  7. if (!defined('PHPUnit_MAIN_METHOD')) {
  8. define('PHPUnit_MAIN_METHOD', 'Zend_Controller_Router_Route_ChainTest::main');
  9. }
  10. require_once dirname(__FILE__) . '/../../../../TestHelper.php';
  11. /** Zend_Config */
  12. require_once 'Zend/Config.php';
  13. /** Zend_Controller_Router_Rewrite */
  14. require_once 'Zend/Controller/Router/Rewrite.php';
  15. /** Zend_Controller_Router_Route_Chain */
  16. require_once 'Zend/Controller/Router/Route/Chain.php';
  17. /** Zend_Controller_Router_Route */
  18. require_once 'Zend/Controller/Router/Route.php';
  19. /** Zend_Controller_Router_Route_Module */
  20. require_once 'Zend/Controller/Router/Route/Module.php';
  21. /** Zend_Controller_Router_Route_Static */
  22. require_once 'Zend/Controller/Router/Route/Static.php';
  23. /** Zend_Controller_Router_Route_Regex */
  24. require_once 'Zend/Controller/Router/Route/Regex.php';
  25. /** Zend_Controller_Router_Route_Hostname */
  26. require_once 'Zend/Controller/Router/Route/Hostname.php';
  27. /** Zend_Controller_Request_Http */
  28. require_once 'Zend/Controller/Request/Http.php';
  29. /** Zend_Uri_Http */
  30. require_once 'Zend/Uri/Http.php';
  31. /** Zend_Config */
  32. require_once 'Zend/Config.php';
  33. /**
  34. * @category Zend
  35. * @package Zend_Controller
  36. * @subpackage UnitTests
  37. */
  38. class Zend_Controller_Router_Route_ChainTest extends PHPUnit_Framework_TestCase
  39. {
  40. /**
  41. * Runs the test methods of this class.
  42. *
  43. * @access public
  44. * @static
  45. */
  46. public static function main()
  47. {
  48. require_once "PHPUnit/TextUI/TestRunner.php";
  49. $suite = new PHPUnit_Framework_TestSuite("Zend_Controller_Router_Route_ChainTest");
  50. $result = PHPUnit_TextUI_TestRunner::run($suite);
  51. }
  52. public function testChaining()
  53. {
  54. $request = new Zend_Controller_Router_ChainTest_Request('http://localhost/foo/bar');
  55. $foo = new Zend_Controller_Router_Route('foo');
  56. $bar = new Zend_Controller_Router_Route('bar');
  57. $chain = $foo->chain($bar);
  58. $this->assertType('Zend_Controller_Router_Route_Chain', $chain);
  59. }
  60. public function testChainingMatch()
  61. {
  62. $chain = new Zend_Controller_Router_Route_Chain();
  63. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 1));
  64. $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 2));
  65. $chain->chain($foo)->chain($bar);
  66. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bla');
  67. $res = $chain->match($request);
  68. $this->assertFalse($res);
  69. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar');
  70. $res = $chain->match($request);
  71. $this->assertEquals(1, $res['foo']);
  72. $this->assertEquals(2, $res['bar']);
  73. }
  74. public function testChainingShortcutMatch()
  75. {
  76. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 1));
  77. $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 2, 'controller' => 'foo', 'action' => 'bar'));
  78. $chain = $foo->chain($bar);
  79. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar');
  80. $res = $chain->match($request);
  81. $this->assertEquals(1, $res['foo']);
  82. $this->assertEquals(2, $res['bar']);
  83. }
  84. public function testChainingMatchFailure()
  85. {
  86. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 1));
  87. $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 2, 'controller' => 'foo', 'action' => 'bar'));
  88. $chain = $foo->chain($bar);
  89. $request = new Zend_Controller_Router_ChainTest_Request('http://nope.zend.com/bar');
  90. $res = $chain->match($request);
  91. $this->assertFalse($res);
  92. }
  93. public function testChainingVariableOverriding()
  94. {
  95. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 1, 'controller' => 'foo', 'module' => 'foo'));
  96. $bar = new Zend_Controller_Router_Route('bar', array('bar' => 2, 'controller' => 'bar', 'action' => 'bar'));
  97. $chain = $foo->chain($bar);
  98. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar');
  99. $res = $chain->match($request);
  100. $this->assertEquals('foo', $res['module']);
  101. $this->assertEquals('bar', $res['controller']);
  102. $this->assertEquals('bar', $res['action']);
  103. }
  104. public function testChainingTooLongPath()
  105. {
  106. $foo = new Zend_Controller_Router_Route_Static('foo', array('foo' => 1));
  107. $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 2));
  108. $chain = $foo->chain($bar);
  109. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/foo/bar/baz');
  110. $res = $chain->match($request);
  111. $this->assertFalse($res);
  112. }
  113. public function testChainingRegex()
  114. {
  115. $foo = new Zend_Controller_Router_Route_Regex('f..', array('foo' => 1));
  116. $bar = new Zend_Controller_Router_Route_Regex('b..', array('bar' => 2));
  117. $chain = $foo->chain($bar);
  118. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/foo/bar');
  119. $res = $chain->match($request);
  120. $this->assertEquals(1, $res['foo']);
  121. $this->assertEquals(2, $res['bar']);
  122. }
  123. public function testChainingModule()
  124. {
  125. $foo = new Zend_Controller_Router_Route_Static('foo', array('foo' => 'bar'));
  126. $bar = new Zend_Controller_Router_Route_Module();
  127. $chain = $foo->chain($bar);
  128. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/foo/bar/baz/var/val');
  129. $res = $chain->match($request);
  130. $this->assertEquals('bar', $res['foo']);
  131. $this->assertEquals('bar', $res['controller']);
  132. $this->assertEquals('baz', $res['action']);
  133. $this->assertEquals('val', $res['var']);
  134. }
  135. public function testVariableOmittingWhenPartial()
  136. {
  137. $foo = new Zend_Controller_Router_Route(':foo', array('foo' => 'foo'));
  138. $bar = new Zend_Controller_Router_Route(':bar', array('bar' => 'bar'));
  139. $chain = $foo->chain($bar);
  140. $path = $chain->assemble(array());
  141. $this->assertEquals('foo/', $path);
  142. }
  143. public function testVariableUnsettingRoute()
  144. {
  145. $foo = new Zend_Controller_Router_Route(':foo');
  146. $bar = new Zend_Controller_Router_Route_Module(array('controller' => 'ctrl', 'action' => 'act'));
  147. $chain = $foo->chain($bar);
  148. $path = $chain->assemble(array('foo' => 'bar', 'baz' => 'bat'));
  149. $this->assertEquals('bar/ctrl/act/baz/bat', $path);
  150. }
  151. public function testVariableUnsettingRegex()
  152. {
  153. $foo = new Zend_Controller_Router_Route_Regex('([^/]+)', array(), array(1 => 'foo'), '%s');
  154. $bar = new Zend_Controller_Router_Route_Module(array('controller' => 'ctrl', 'action' => 'act'));
  155. $chain = $foo->chain($bar);
  156. $path = $chain->assemble(array('foo' => 'bar', 'baz' => 'bat'));
  157. $this->assertEquals('bar/ctrl/act/baz/bat', $path);
  158. }
  159. public function testChainingSeparatorOverriding()
  160. {
  161. $foo = new Zend_Controller_Router_Route_Static('foo', array('foo' => 1));
  162. $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 2));
  163. $baz = new Zend_Controller_Router_Route_Static('baz', array('baz' => 3));
  164. $chain = $foo->chain($bar, '.');
  165. $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo.bar'));
  166. $this->assertType('array', $res);
  167. $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo/bar'));
  168. $this->assertEquals(false, $res);
  169. $chain->chain($baz, ':');
  170. $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/foo.bar:baz'));
  171. $this->assertType('array', $res);
  172. }
  173. public function testI18nChaining()
  174. {
  175. $lang = new Zend_Controller_Router_Route(':lang', array('lang' => 'en'));
  176. $profile = new Zend_Controller_Router_Route('user/:id', array('controller' => 'foo', 'action' => 'bar'));
  177. $chain = $lang->chain($profile);
  178. $res = $chain->match(new Zend_Controller_Router_ChainTest_Request('http://localhost/en/user/1'));
  179. $this->assertEquals('en', $res['lang']);
  180. $this->assertEquals('1', $res['id']);
  181. }
  182. public function testChainingAssembleWithRoutePlaceholder()
  183. {
  184. $chain = new Zend_Controller_Router_Route_Chain();
  185. $foo = new Zend_Controller_Router_Route_Hostname(':account.zend.com');
  186. $bar = new Zend_Controller_Router_Route('bar/*');
  187. $chain->chain($foo)->chain($bar);
  188. $request = new Zend_Controller_Router_ChainTest_Request('http://foobar.zend.com/bar');
  189. $res = $chain->match($request);
  190. $this->assertType('array', $res);
  191. $this->assertRegexp('#[^a-z0-9]?foobar\.zend\.com/bar/foo/bar#i', $chain->assemble(array('account' => 'foobar', 'foo' => 'bar')));
  192. }
  193. public function testChainingAssembleWithStatic()
  194. {
  195. $chain = new Zend_Controller_Router_Route_Chain();
  196. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 'foo'));
  197. $bar = new Zend_Controller_Router_Route_Static('bar', array('bar' => 'bar'));
  198. $chain->chain($foo)->chain($bar);
  199. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar');
  200. $res = $chain->match($request);
  201. $this->assertType('array', $res);
  202. $this->assertRegexp('#[^a-z0-9]?www\.zend\.com/bar$#i', $chain->assemble());
  203. }
  204. public function testChainingAssembleWithRegex()
  205. {
  206. $chain = new Zend_Controller_Router_Route_Chain();
  207. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 'foo'));
  208. $bar = new Zend_Controller_Router_Route_Regex('bar', array('bar' => 'bar'), array(), 'bar');
  209. $chain->chain($foo)->chain($bar);
  210. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/bar');
  211. $res = $chain->match($request);
  212. $this->assertType('array', $res);
  213. $this->assertRegexp('#[^a-z0-9]?www\.zend\.com/bar$#i', $chain->assemble());
  214. }
  215. public function testChainingReuse()
  216. {
  217. $foo = new Zend_Controller_Router_Route_Hostname('www.zend.com', array('foo' => 'foo'));
  218. $profile = new Zend_Controller_Router_Route('user/:id', array('controller' => 'prof'));
  219. $article = new Zend_Controller_Router_Route('article/:id', array('controller' => 'art', 'action' => 'art'));
  220. $profileChain = $foo->chain($profile);
  221. $articleChain = $foo->chain($article);
  222. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/user/1');
  223. $res = $profileChain->match($request);
  224. $this->assertType('array', $res);
  225. $this->assertEquals('prof', $res['controller']);
  226. $request = new Zend_Controller_Router_ChainTest_Request('http://www.zend.com/article/1');
  227. $res = $articleChain->match($request);
  228. $this->assertType('array', $res);
  229. $this->assertEquals('art', $res['controller']);
  230. $this->assertEquals('art', $res['action']);
  231. }
  232. public function testConfigChaining()
  233. {
  234. $routes = array(
  235. /** Abstract routes */
  236. 'www' => array(
  237. 'type' => 'Zend_Controller_Router_Route_Hostname',
  238. 'route' => 'www.example.com',
  239. 'abstract' => true
  240. ),
  241. 'user' => array(
  242. 'type' => 'Zend_Controller_Router_Route_Hostname',
  243. 'route' => 'user.example.com',
  244. 'abstract' => true
  245. ),
  246. 'index' => array(
  247. 'type' => 'Zend_Controller_Router_Route_Static',
  248. 'route' => '',
  249. 'abstract' => true,
  250. 'defaults' => array(
  251. 'module' => 'default',
  252. 'controller' => 'index',
  253. 'action' => 'index'
  254. )
  255. ),
  256. 'imprint' => array(
  257. 'type' => 'Zend_Controller_Router_Route_Static',
  258. 'route' => 'imprint',
  259. 'abstract' => true,
  260. 'defaults' => array(
  261. 'module' => 'default',
  262. 'controller' => 'index',
  263. 'action' => 'imprint'
  264. )
  265. ),
  266. 'profile' => array(
  267. 'type' => 'Zend_Controller_Router_Route_Static',
  268. 'route' => 'profile',
  269. 'abstract' => true,
  270. 'defaults' => array(
  271. 'module' => 'user',
  272. 'controller' => 'profile',
  273. 'action' => 'index'
  274. )
  275. ),
  276. 'profile-edit' => array(
  277. 'type' => 'Zend_Controller_Router_Route_Static',
  278. 'route' => 'profile/edit',
  279. 'abstract' => true,
  280. 'defaults' => array(
  281. 'module' => 'user',
  282. 'controller' => 'profile',
  283. 'action' => 'edit'
  284. )
  285. ),
  286. /** Chains */
  287. 'www-index' => array(
  288. 'type' => 'Zend_Controller_Router_Route_Chain',
  289. 'chain' => 'www, index' // or array('www-subdomain', 'index'); / maybe both
  290. ),
  291. 'www-imprint' => array(
  292. 'type' => 'Zend_Controller_Router_Route_Chain',
  293. 'chain' => 'www, imprint'
  294. ),
  295. 'user-index' => array(
  296. 'type' => 'Zend_Controller_Router_Route_Chain',
  297. 'chain' => 'user, index'
  298. ),
  299. 'user-profile' => array(
  300. 'type' => 'Zend_Controller_Router_Route_Chain',
  301. 'chain' => 'user, profile'
  302. ),
  303. 'user-profile-edit' => array(
  304. 'type' => 'Zend_Controller_Router_Route_Chain',
  305. 'chain' => 'user, profile-edit'
  306. )
  307. );
  308. $router = new Zend_Controller_Router_Rewrite();
  309. $front = Zend_Controller_Front::getInstance();
  310. $front->resetInstance();
  311. $front->setDispatcher(new Zend_Controller_Router_RewriteTest_Dispatcher());
  312. $front->setRequest(new Zend_Controller_Router_RewriteTest_Request());
  313. $router->setFrontController($front);
  314. $router->addConfig(new Zend_Config($routes));
  315. $request = new Zend_Controller_Router_ChainTest_Request('http://user.example.com/profile');
  316. $token = $router->route($request);
  317. $this->assertEquals('user', $token->getModuleName());
  318. $this->assertEquals('profile', $token->getControllerName());
  319. $this->assertEquals('index', $token->getActionName());
  320. $request = new Zend_Controller_Router_ChainTest_Request('http://foo.example.com/imprint');
  321. $token = $router->route($request);
  322. $this->assertEquals('default', $token->getModuleName());
  323. $this->assertEquals('imprint', $token->getControllerName());
  324. $this->assertEquals('defact', $token->getActionName());
  325. }
  326. public function testConfigChainingAlternative()
  327. {
  328. $routes = array(
  329. 'www' => array(
  330. 'type' => 'Zend_Controller_Router_Route_Hostname',
  331. 'route' => 'www.example.com',
  332. 'chains' => array(
  333. 'index' => array(
  334. 'type' => 'Zend_Controller_Router_Route_Static',
  335. 'route' => '',
  336. 'defaults' => array(
  337. 'module' => 'default',
  338. 'controller' => 'index',
  339. 'action' => 'index'
  340. )
  341. ),
  342. 'imprint' => array(
  343. 'type' => 'Zend_Controller_Router_Route_Static',
  344. 'route' => 'imprint',
  345. 'defaults' => array(
  346. 'module' => 'default',
  347. 'controller' => 'index',
  348. 'action' => 'imprint'
  349. )
  350. ),
  351. )
  352. ),
  353. 'user' => array(
  354. 'type' => 'Zend_Controller_Router_Route_Hostname',
  355. 'route' => 'user.example.com',
  356. 'chains' => array(
  357. 'profile' => array(
  358. 'type' => 'Zend_Controller_Router_Route_Static',
  359. 'route' => 'profile',
  360. 'defaults' => array(
  361. 'module' => 'user',
  362. 'controller' => 'profile',
  363. 'action' => 'index'
  364. ),
  365. 'chains' => array(
  366. 'standard' => array(
  367. 'type' => 'Zend_Controller_Router_Route_Static',
  368. 'route' => 'standard2',
  369. 'defaults' => array(
  370. 'mode' => 'standard'
  371. )
  372. ),
  373. 'detail' => array(
  374. 'type' => 'Zend_Controller_Router_Route_Static',
  375. 'route' => 'detail',
  376. 'defaults' => array(
  377. 'mode' => 'detail'
  378. )
  379. )
  380. )
  381. ),
  382. 'profile-edit' => array(
  383. 'type' => 'Zend_Controller_Router_Route_Static',
  384. 'route' => 'profile/edit',
  385. 'defaults' => array(
  386. 'module' => 'user',
  387. 'controller' => 'profile',
  388. 'action' => 'edit'
  389. )
  390. ),
  391. )
  392. ),
  393. );
  394. $router = $this->_getRouter();
  395. $router->addConfig(new Zend_Config($routes));
  396. $request = new Zend_Controller_Router_ChainTest_Request('http://user.example.com/profile/edit');
  397. $token = $router->route($request);
  398. $this->assertEquals('user', $token->getModuleName());
  399. $this->assertEquals('profile', $token->getControllerName());
  400. $this->assertEquals('edit', $token->getActionName());
  401. $request = new Zend_Controller_Router_ChainTest_Request('http://user.example.com/profile/detail');
  402. $token = $router->route($request);
  403. $this->assertEquals('user', $token->getModuleName());
  404. $this->assertEquals('profile', $token->getControllerName());
  405. $this->assertEquals('index', $token->getActionName());
  406. $this->assertEquals('detail', $token->getParam('mode'));
  407. $request = new Zend_Controller_Router_ChainTest_Request('http://user.example.com/profile');
  408. $token = $router->route($request);
  409. }
  410. public function testConfigChainingMixed()
  411. {
  412. $routes = array(
  413. 'index' => array(
  414. 'type' => 'Zend_Controller_Router_Route_Static',
  415. 'route' => '',
  416. 'defaults' => array(
  417. 'module' => 'default',
  418. 'controller' => 'index',
  419. 'action' => 'index'
  420. )
  421. ),
  422. 'www' => array(
  423. 'type' => 'Zend_Controller_Router_Route_Hostname',
  424. 'route' => 'www.example.com',
  425. 'chains' => array(
  426. 'index',
  427. 'imprint' => array(
  428. 'type' => 'Zend_Controller_Router_Route_Static',
  429. 'route' => 'imprint',
  430. 'defaults' => array(
  431. 'module' => 'default',
  432. 'controller' => 'index',
  433. 'action' => 'imprint'
  434. )
  435. ),
  436. )
  437. ),
  438. 'user' => array(
  439. 'type' => 'Zend_Controller_Router_Route_Hostname',
  440. 'route' => 'user.example.com',
  441. 'chains' => array(
  442. 'index',
  443. 'profile' => array(
  444. 'type' => 'Zend_Controller_Router_Route_Static',
  445. 'route' => 'profile',
  446. 'defaults' => array(
  447. 'module' => 'user',
  448. 'controller' => 'profile',
  449. 'action' => 'index'
  450. )
  451. ),
  452. 'profile-edit' => array(
  453. 'type' => 'Zend_Controller_Router_Route_Static',
  454. 'route' => 'profile/edit',
  455. 'defaults' => array(
  456. 'module' => 'user',
  457. 'controller' => 'profile',
  458. 'action' => 'edit'
  459. )
  460. ),
  461. )
  462. ),
  463. );
  464. $router = $this->_getRouter();
  465. $router->addConfig(new Zend_Config($routes));
  466. $request = new Zend_Controller_Router_ChainTest_Request('http://user.example.com');
  467. $token = $router->route($request);
  468. $this->assertEquals('default', $token->getModuleName());
  469. $this->assertEquals('index', $token->getControllerName());
  470. $this->assertEquals('index', $token->getActionName());
  471. $this->assertType('Zend_Controller_Router_Route_Chain', $router->getRoute('user-profile'));
  472. $this->assertType('Zend_Controller_Router_Route_Chain', $router->getRoute('www-imprint'));
  473. $this->assertType('Zend_Controller_Router_Route_Chain', $router->getRoute('www-index'));
  474. $this->assertType('Zend_Controller_Router_Route_Chain', $router->getRoute('www-index'));
  475. }
  476. protected function _getRouter()
  477. {
  478. $router = new Zend_Controller_Router_Rewrite();
  479. $front = Zend_Controller_Front::getInstance();
  480. $front->resetInstance();
  481. $front->setRequest(new Zend_Controller_Router_ChainTest_Request());
  482. $router->setFrontController($front);
  483. return $router;
  484. }
  485. }
  486. /**
  487. * Zend_Controller_Router_ChainTest_Request - request object for router testing
  488. *
  489. * @uses Zend_Controller_Request_Interface
  490. */
  491. class Zend_Controller_Router_ChainTest_Request extends Zend_Controller_Request_Http
  492. {
  493. protected $_host;
  494. protected $_port;
  495. public function __construct($uri = null)
  496. {
  497. if (null === $uri) {
  498. $uri = 'http://localhost/foo/bar/baz/2';
  499. }
  500. $uri = Zend_Uri_Http::fromString($uri);
  501. $this->_host = $uri->getHost();
  502. $this->_port = $uri->getPort();
  503. parent::__construct($uri);
  504. }
  505. public function getHttpHost() {
  506. $return = $this->_host;
  507. if ($this->_port) $return .= ':' . $this->_port;
  508. return $return;
  509. }
  510. }
  511. if (PHPUnit_MAIN_METHOD == "Zend_Controller_Router_Route_ChainTest::main") {
  512. Zend_Controller_Router_Route_ChainTest::main();
  513. }