@@ -21,14 +21,14 @@ test(function () {
21
21
22
22
$ factory = new RequestFactory ;
23
23
$ factory ->setProxy ('127.0.0.1 ' );
24
- Assert::same ('127.0.0.3 ' , $ factory ->createHttpRequest ()->getRemoteAddress ());
25
- Assert::same ('localhost ' , $ factory ->createHttpRequest ()->getRemoteHost ());
24
+ Assert::same ('127.0.0.3 ' , $ factory ->fromGlobals ()->getRemoteAddress ());
25
+ Assert::same ('localhost ' , $ factory ->fromGlobals ()->getRemoteHost ());
26
26
27
27
$ factory ->setProxy ('127.0.0.1/8 ' );
28
- Assert::same ('23.75.45.200 ' , $ factory ->createHttpRequest ()->getRemoteAddress ());
29
- Assert::same ('192.168.0.1 ' , $ factory ->createHttpRequest ()->getRemoteHost ());
28
+ Assert::same ('23.75.45.200 ' , $ factory ->fromGlobals ()->getRemoteAddress ());
29
+ Assert::same ('192.168.0.1 ' , $ factory ->fromGlobals ()->getRemoteHost ());
30
30
31
- $ url = $ factory ->createHttpRequest ()->getUrl ();
31
+ $ url = $ factory ->fromGlobals ()->getUrl ();
32
32
Assert::same ('http ' , $ url ->getScheme ());
33
33
Assert::same ('192.168.0.1 ' , $ url ->getHost ());
34
34
});
@@ -43,10 +43,10 @@ test(function () {
43
43
$ factory = new RequestFactory ;
44
44
45
45
$ factory ->setProxy ('127.0.0.3 ' );
46
- Assert::same ('23.75.45.200 ' , $ factory ->createHttpRequest ()->getRemoteAddress ());
47
- Assert::same ('192.168.0.1 ' , $ factory ->createHttpRequest ()->getRemoteHost ());
46
+ Assert::same ('23.75.45.200 ' , $ factory ->fromGlobals ()->getRemoteAddress ());
47
+ Assert::same ('192.168.0.1 ' , $ factory ->fromGlobals ()->getRemoteHost ());
48
48
49
- $ url = $ factory ->createHttpRequest ()->getUrl ();
49
+ $ url = $ factory ->fromGlobals ()->getUrl ();
50
50
Assert::same (8080 , $ url ->getPort ());
51
51
Assert::same ('192.168.0.1 ' , $ url ->getHost ());
52
52
});
@@ -62,10 +62,10 @@ test(function () {
62
62
$ factory = new RequestFactory ;
63
63
64
64
$ factory ->setProxy ('127.0.0.3 ' );
65
- Assert::same ('2001:db8:cafe::17 ' , $ factory ->createHttpRequest ()->getRemoteAddress ());
66
- Assert::same ('2001:db8:cafe::18 ' , $ factory ->createHttpRequest ()->getRemoteHost ());
65
+ Assert::same ('2001:db8:cafe::17 ' , $ factory ->fromGlobals ()->getRemoteAddress ());
66
+ Assert::same ('2001:db8:cafe::18 ' , $ factory ->fromGlobals ()->getRemoteHost ());
67
67
68
- $ url = $ factory ->createHttpRequest ()->getUrl ();
68
+ $ url = $ factory ->fromGlobals ()->getUrl ();
69
69
Assert::same ('2001:db8:cafe::18 ' , $ url ->getHost ());
70
70
});
71
71
@@ -79,10 +79,10 @@ test(function () {
79
79
$ factory = new RequestFactory ;
80
80
81
81
$ factory ->setProxy ('127.0.0.3 ' );
82
- Assert::same ('2001:db8:cafe::17 ' , $ factory ->createHttpRequest ()->getRemoteAddress ());
83
- Assert::same ('2001:db8:cafe::18 ' , $ factory ->createHttpRequest ()->getRemoteHost ());
82
+ Assert::same ('2001:db8:cafe::17 ' , $ factory ->fromGlobals ()->getRemoteAddress ());
83
+ Assert::same ('2001:db8:cafe::18 ' , $ factory ->fromGlobals ()->getRemoteHost ());
84
84
85
- $ url = $ factory ->createHttpRequest ()->getUrl ();
85
+ $ url = $ factory ->fromGlobals ()->getUrl ();
86
86
Assert::same (47832 , $ url ->getPort ());
87
87
Assert::same ('2001:db8:cafe::18 ' , $ url ->getHost ());
88
88
});
@@ -98,6 +98,6 @@ test(function () {
98
98
$ factory = new RequestFactory ;
99
99
$ factory ->setProxy ('127.0.0.3 ' );
100
100
101
- $ url = $ factory ->createHttpRequest ()->getUrl ();
101
+ $ url = $ factory ->fromGlobals ()->getUrl ();
102
102
Assert::same ('https ' , $ url ->getScheme ());
103
103
});
0 commit comments