@@ 27-46 (lines=20) @@ | ||
24 | $this->assertEqualsWithDelta(\time(), $notFound->getTimestamp()->format('U'), 1); |
|
25 | } |
|
26 | ||
27 | public function pathProvider() |
|
28 | { |
|
29 | return [ |
|
30 | ['foo/bar', '/foo/bar'], |
|
31 | ['/foo/bar/', '/foo/bar/'], |
|
32 | ['foo', '/foo'], |
|
33 | ['foo/bar ', '/foo/bar'], |
|
34 | [' foo/bar/', '/foo/bar/'], |
|
35 | [' /foo', '/foo'], |
|
36 | ['http://www.example.com/foo', '/foo'], |
|
37 | ['http://www.example.com/', '/'], |
|
38 | ['http://www.example.com', '/'], |
|
39 | ['foo/bar?baz=true', '/foo/bar'], |
|
40 | ['http://www.example.com/foo?baz=bar&foo=baz', '/foo'], |
|
41 | ['http://www.example.com/foo?baz=bar&foo=baz#baz', '/foo'], |
|
42 | ['', null], |
|
43 | [' ', null], |
|
44 | ['/', '/'], |
|
45 | ]; |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * @return \Zenstruck\RedirectBundle\Model\NotFound |
@@ 77-96 (lines=20) @@ | ||
74 | $this->assertSame('/foo', $redirect->getSource()); |
|
75 | } |
|
76 | ||
77 | public function sourceProvider() |
|
78 | { |
|
79 | return [ |
|
80 | ['foo/bar', '/foo/bar'], |
|
81 | ['/foo/bar/', '/foo/bar/'], |
|
82 | ['foo', '/foo'], |
|
83 | ['foo/bar ', '/foo/bar'], |
|
84 | [' foo/bar/', '/foo/bar/'], |
|
85 | [' /foo', '/foo'], |
|
86 | ['http://www.example.com/foo', '/foo'], |
|
87 | ['http://www.example.com/', '/'], |
|
88 | ['http://www.example.com', '/'], |
|
89 | ['foo/bar?baz=true', '/foo/bar'], |
|
90 | ['http://www.example.com/foo?baz=bar&foo=baz', '/foo'], |
|
91 | ['http://www.example.com/foo?baz=bar&foo=baz#baz', '/foo'], |
|
92 | ['', null], |
|
93 | [' ', null], |
|
94 | ['/', '/'], |
|
95 | ]; |
|
96 | } |
|
97 | ||
98 | public function destinationProvider() |
|
99 | { |