forked from laruence/yaf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
008.phpt
73 lines (63 loc) · 1.48 KB
/
008.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
--TEST--
Check for Yaf_Router
--SKIPIF--
<?php if (!extension_loaded("yaf")) print "skip"; ?>
--INI--
yaf.use_namespace=0
--FILE--
<?php
$router = new Yaf_Router();
$route = new Yaf_Route_Simple('m', 'c', 'a');
$sroute = new Yaf_Route_Supervar('r');
$router->addRoute("simple", $route)->addRoute("super", $sroute);
print_r($router);
var_dump($router->getCurrentRoute());
print_r($router->getRoutes());
print_r($router->getRoute("simple"));
var_dump($router->getRoute("noexists"));
?>
--EXPECTF--
Yaf_Router Object
(
[_routes:protected] => Array
(
[_default] => Yaf_Route_Static Object
(
)
[simple] => Yaf_Route_Simple Object
(
[controller:protected] => c
[module:protected] => m
[action:protected] => a
)
[super] => Yaf_Route_Supervar Object
(
[_var_name:protected] => r
)
)
[_current:protected] =>
)
NULL
Array
(
[_default] => Yaf_Route_Static Object
(
)
[simple] => Yaf_Route_Simple Object
(
[controller:protected] => c
[module:protected] => m
[action:protected] => a
)
[super] => Yaf_Route_Supervar Object
(
[_var_name:protected] => r
)
)
Yaf_Route_Simple Object
(
[controller:protected] => c
[module:protected] => m
[action:protected] => a
)
NULL