forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bug62702.phpt
55 lines (46 loc) · 1.46 KB
/
bug62702.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--TEST--
FR #62702 (Make baseuri case-insensitive)
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$router = new Yaf_Route_Static();
$request = new Yaf_Request_Http("/sample", "/sample");
$router->route($request);
var_dump($request->getControllerName());
$request = new Yaf_Request_Http("/Sample/ABC", "/sample");
$router->route($request);
var_dump($request->getControllerName());
$router = new Yaf_Route_Map(true);
$request = new Yaf_Request_Http("/sample/A/B/C", "/sample");
$router->route($request);
var_dump($request->getControllerName());
$request = new Yaf_Request_Http("/sample", "/sAmplE");
$router->route($request);
var_dump($request->getControllerName());
$router = new Yaf_Route_Regex("#^/test#", array("controller" => "info"), array());
$request = new Yaf_Request_Http("/test/", "/Test");
$router->route($request);
var_dump($request->getControllerName());
$request = new Yaf_Request_Http("/sample/test", "/sAmplE");
$router->route($request);
var_dump($request->getControllerName());
$router = new Yaf_Route_Rewrite("/test", array("controller" => "info"), array());
$request = new Yaf_Request_Http("/test/", "/Test");
$router->route($request);
var_dump($request->getControllerName());
$request = new Yaf_Request_Http("/sample/test", "/sAmplE");
$router->route($request);
var_dump($request->getControllerName());
?>
--EXPECTF--
NULL
string(3) "ABC"
string(5) "A_B_C"
NULL
NULL
string(4) "info"
NULL
string(4) "info"