@@ -64,20 +64,25 @@ public function testCheck()
64
64
65
65
public function testCheckWithDifferentArgSeparator ()
66
66
{
67
- $ this ->iniSet ('arg_separator.output ' , '& ' );
68
- $ signer = new UriSigner ('foobar ' );
69
-
70
- $ this ->assertSame (
71
- 'http://example.com/foo?_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D&baz=bay&foo=bar ' ,
72
- $ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' )
73
- );
74
- $ this ->assertTrue ($ signer ->check ($ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' )));
75
-
76
- $ this ->assertSame (
77
- 'http://example.com/foo?_expiration=2145916800&_hash=xLhnPMzV3KqqHaaUffBUJvtRDAZ4%2FZ9Y8Sw%2BgmS%2B82Q%3D&baz=bay&foo=bar ' ,
78
- $ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' , new \DateTimeImmutable ('2038-01-01 00:00:00 ' , new \DateTimeZone ('UTC ' )))
79
- );
80
- $ this ->assertTrue ($ signer ->check ($ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' , new \DateTimeImmutable ('2099-01-01 00:00:00 ' ))));
67
+ $ oldArgSeparatorOutputValue = ini_set ('arg_separator.output ' , '& ' );
68
+
69
+ try {
70
+ $ signer = new UriSigner ('foobar ' );
71
+
72
+ $ this ->assertSame (
73
+ 'http://example.com/foo?_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D&baz=bay&foo=bar ' ,
74
+ $ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' )
75
+ );
76
+ $ this ->assertTrue ($ signer ->check ($ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' )));
77
+
78
+ $ this ->assertSame (
79
+ 'http://example.com/foo?_expiration=2145916800&_hash=xLhnPMzV3KqqHaaUffBUJvtRDAZ4%2FZ9Y8Sw%2BgmS%2B82Q%3D&baz=bay&foo=bar ' ,
80
+ $ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' , new \DateTimeImmutable ('2038-01-01 00:00:00 ' , new \DateTimeZone ('UTC ' )))
81
+ );
82
+ $ this ->assertTrue ($ signer ->check ($ signer ->sign ('http://example.com/foo?foo=bar&baz=bay ' , new \DateTimeImmutable ('2099-01-01 00:00:00 ' ))));
83
+ } finally {
84
+ ini_set ('arg_separator.output ' , $ oldArgSeparatorOutputValue );
85
+ }
81
86
}
82
87
83
88
public function testCheckWithRequest ()
0 commit comments