@@ 45-61 (lines=17) @@ | ||
42 | $this->register($request, $response)->shouldBe($this->getWrappedObject()); |
|
43 | } |
|
44 | ||
45 | function it_retrieves_the_server_parameters_on_post( |
|
46 | ServerRequestInterface $request, |
|
47 | ResponseInterface $response |
|
48 | ) |
|
49 | { |
|
50 | $request->getServerParams()->willReturn( |
|
51 | [ |
|
52 | 'foo' => 'bar', |
|
53 | 'bar' => 'baz' |
|
54 | ] |
|
55 | ); |
|
56 | $this->register($request, $response); |
|
57 | $this->getPost()->shouldBe([ |
|
58 | 'foo' => 'bar', |
|
59 | 'bar' => 'baz' |
|
60 | ]); |
|
61 | } |
|
62 | ||
63 | function it_can_retrieve_a_single_named_parameter( |
|
64 | ServerRequestInterface $request, |
|
@@ 63-76 (lines=14) @@ | ||
60 | ]); |
|
61 | } |
|
62 | ||
63 | function it_can_retrieve_a_single_named_parameter( |
|
64 | ServerRequestInterface $request, |
|
65 | ResponseInterface $response |
|
66 | ) |
|
67 | { |
|
68 | $request->getServerParams()->willReturn( |
|
69 | [ |
|
70 | 'foo' => 'bar', |
|
71 | 'bar' => 'baz' |
|
72 | ] |
|
73 | ); |
|
74 | $this->register($request, $response); |
|
75 | $this->getPost('bar')->shouldBe('baz'); |
|
76 | } |
|
77 | ||
78 | function it_returns_a_default_value_if_param_is_not_set( |
|
79 | ServerRequestInterface $request, |
|
@@ 78-91 (lines=14) @@ | ||
75 | $this->getPost('bar')->shouldBe('baz'); |
|
76 | } |
|
77 | ||
78 | function it_returns_a_default_value_if_param_is_not_set( |
|
79 | ServerRequestInterface $request, |
|
80 | ResponseInterface $response |
|
81 | ) |
|
82 | { |
|
83 | $request->getServerParams()->willReturn( |
|
84 | [ |
|
85 | 'foo' => 'bar', |
|
86 | 'bar' => 'baz' |
|
87 | ] |
|
88 | ); |
|
89 | $this->register($request, $response); |
|
90 | $this->getPost('boo', 'test')->shouldBe('test'); |
|
91 | } |
|
92 | ||
93 | function it_can_get_URL_parameters( |
|
94 | ServerRequestInterface $request, |