File tree Expand file tree Collapse file tree 2 files changed +38
-12
lines changed Expand file tree Collapse file tree 2 files changed +38
-12
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Class ServerRequestFactoryTest
4+ *
5+ * @filesource ServerRequestFactoryTest.php
6+ * @created 06.11.2019
7+ * @package chillerlan\HTTPTest\Psr17
8+ * @author smiley <smiley@chillerlan.net>
9+ * @copyright 2019 smiley
10+ * @license MIT
11+ */
12+
13+ namespace chillerlan \HTTPTest \Psr17 ;
14+
15+ use chillerlan \HTTP \Psr17 \ServerRequestFactory ;
16+ use PHPUnit \Framework \TestCase ;
17+
18+ class ServerRequestFactoryTest extends TestCase{
19+
20+ /**
21+ * @var \chillerlan\HTTP\Psr17\ServerRequestFactory
22+ */
23+ protected $ serverRequestFactory ;
24+
25+ protected function setUp ():void {
26+ $ this ->serverRequestFactory = new ServerRequestFactory ;
27+ }
28+
29+ // coverage
30+ public function testCookieParams (){
31+ $ r = $ this ->serverRequestFactory
32+ ->createServerRequest ($ this ->serverRequestFactory ::METHOD_GET , '/ ' );
33+
34+ $ this ->assertSame ('/ ' , $ r ->getUri ()->__toString ());
35+ }
36+
37+ }
Original file line number Diff line number Diff line change 1515namespace chillerlan \HTTPTest \Psr7 ;
1616
1717use chillerlan \HTTP \Psr7 \{ServerRequest , UploadedFile };
18- use chillerlan \HTTP \Psr17 \ServerRequestFactory ;
1918use InvalidArgumentException ;
2019use PHPUnit \Framework \TestCase ;
2120
2221class ServerRequestTest extends TestCase{
2322
24- /**
25- * @var \chillerlan\HTTP\Psr17\ServerRequestFactory
26- */
27- protected $ serverRequestFactory ;
28-
29- protected function setUp ():void {
30- $ this ->serverRequestFactory = new ServerRequestFactory ;
31- }
32-
3323 public function testServerParams (){
3424 $ params = ['name ' => 'value ' ];
3525
@@ -38,8 +28,7 @@ public function testServerParams(){
3828 }
3929
4030 public function testCookieParams (){
41- $ r1 = $ this ->serverRequestFactory
42- ->createServerRequest ($ this ->serverRequestFactory ::METHOD_GET , '/ ' ); // ServerRequestFactory coverage
31+ $ r1 = new ServerRequest ('GET ' , '/ ' );
4332
4433 $ params = ['name ' => 'value ' ];
4534
You can’t perform that action at this time.
0 commit comments