Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 3bab453

Browse files
committed
Merge branch 'hotfix/5'
Close #5
2 parents ddd35f2 + 6685127 commit 3bab453

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/ServerRequestTest.php

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,19 @@ public function testRemovingAttributeReturnsCloneWithoutAttribute($request)
101101
$this->assertNull($new->getAttribute('foo', null));
102102
}
103103

104-
public function testUsesProvidedConstructorArguments()
104+
public function provideMethods()
105+
{
106+
return [
107+
'post' => ['POST', 'POST'],
108+
'get' => ['GET', 'GET'],
109+
'null' => [null, 'GET'],
110+
];
111+
}
112+
113+
/**
114+
* @dataProvider provideMethods
115+
*/
116+
public function testUsesProvidedConstructorArguments($parameterMethod, $methodReturned)
105117
{
106118
$server = [
107119
'foo' => 'bar',
@@ -115,7 +127,6 @@ public function testUsesProvidedConstructorArguments()
115127
];
116128

117129
$uri = new Uri('http://example.com');
118-
$method = 'POST';
119130
$headers = [
120131
'host' => ['example.com'],
121132
];
@@ -124,7 +135,7 @@ public function testUsesProvidedConstructorArguments()
124135
$server,
125136
$files,
126137
$uri,
127-
$method,
138+
$parameterMethod,
128139
'php://memory',
129140
$headers
130141
);
@@ -133,7 +144,7 @@ public function testUsesProvidedConstructorArguments()
133144
$this->assertEquals($files, $request->getUploadedFiles());
134145

135146
$this->assertSame($uri, $request->getUri());
136-
$this->assertEquals($method, $request->getMethod());
147+
$this->assertEquals($methodReturned, $request->getMethod());
137148
$this->assertEquals($headers, $request->getHeaders());
138149

139150
$body = $request->getBody();

0 commit comments

Comments
 (0)