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

Commit 3d3fa15

Browse files
committed
added more tests
1 parent 9fd285e commit 3d3fa15

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
@@ -97,7 +97,19 @@ public function testRemovingAttributeReturnsCloneWithoutAttribute($request)
9797
$this->assertNull($new->getAttribute('foo', null));
9898
}
9999

100-
public function testUsesProvidedConstructorArguments()
100+
public function provideMethods()
101+
{
102+
return array(
103+
array('POST', 'POST'),
104+
array('GET', 'GET'),
105+
array(null, 'GET'),
106+
);
107+
}
108+
109+
/**
110+
* @dataProvider provideMethods
111+
*/
112+
public function testUsesProvidedConstructorArguments($parameterMethod, $methodReturned)
101113
{
102114
$server = [
103115
'foo' => 'bar',
@@ -111,7 +123,6 @@ public function testUsesProvidedConstructorArguments()
111123
];
112124

113125
$uri = new Uri('http://example.com');
114-
$method = 'POST';
115126
$headers = [
116127
'host' => ['example.com'],
117128
];
@@ -120,7 +131,7 @@ public function testUsesProvidedConstructorArguments()
120131
$server,
121132
$files,
122133
$uri,
123-
$method,
134+
$parameterMethod,
124135
'php://memory',
125136
$headers
126137
);
@@ -129,7 +140,7 @@ public function testUsesProvidedConstructorArguments()
129140
$this->assertEquals($files, $request->getUploadedFiles());
130141

131142
$this->assertSame($uri, $request->getUri());
132-
$this->assertEquals($method, $request->getMethod());
143+
$this->assertEquals($methodReturned, $request->getMethod());
133144
$this->assertEquals($headers, $request->getHeaders());
134145

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

0 commit comments

Comments
 (0)