27
27
28
28
class FactoriesTest extends TestCase
29
29
{
30
- public function testRequestFactory ()
30
+ public function test_RequestFactory ()
31
31
{
32
32
$ factory = new Factory \RequestFactory ();
33
33
$ this ->assertInstanceOf (Request::class, $ factory ->createRequest ('GET ' , 'http://example.com ' ));
34
34
}
35
35
36
- public function testServerRequestFactory ()
36
+ public function test_ServerRequestFactory ()
37
37
{
38
38
$ factory = new Factory \ServerRequestFactory ();
39
39
$ this ->assertInstanceOf (ServerRequest::class, $ factory ->createServerRequest ('POST ' , 'http://example.com ' ));
40
40
}
41
41
42
- public function testResponseFactory ()
42
+ public function test_ResponseFactory ()
43
43
{
44
44
$ factory = new Factory \ResponseFactory ();
45
45
$ this ->assertInstanceOf (Response::class, $ factory ->createResponse ());
46
46
}
47
47
48
- public function testStreamFactory ()
48
+ public function test_StreamFactory ()
49
49
{
50
50
$ factory = new Factory \StreamFactory ();
51
51
$ this ->assertInstanceOf (Stream::class, $ factory ->createStream ('contents ' ));
52
52
$ this ->assertInstanceOf (Stream::class, $ factory ->createStreamFromFile ('php://temp ' ));
53
53
$ this ->assertInstanceOf (Stream::class, $ factory ->createStreamFromResource (fopen ('php://temp ' , 'w+b ' )));
54
54
}
55
55
56
- public function testInvalidStreamMode_ThrowsException ()
56
+ public function test_InvalidStreamMode_ThrowsException ()
57
57
{
58
58
$ factory = new Factory \StreamFactory ();
59
59
$ this ->expectException (InvalidArgumentException::class);
60
60
$ this ->assertInstanceOf (Stream::class, $ factory ->createStreamFromFile ('someFile.txt ' , 'invalid ' ));
61
61
}
62
62
63
- public function testInvalidStreamFilename_ThrowsException ()
63
+ public function test_InvalidStreamFilename_ThrowsException ()
64
64
{
65
65
$ factory = new Factory \StreamFactory ();
66
66
$ this ->expectException (RuntimeException::class);
67
67
$ this ->assertInstanceOf (Stream::class, $ factory ->createStreamFromFile ('not-A-File.txt ' ));
68
68
}
69
69
70
- public function testUploadedFileFactory ()
70
+ public function test_UploadedFileFactory ()
71
71
{
72
72
$ factory = new Factory \UploadedFileFactory ();
73
73
$ this ->assertInstanceOf (UploadedFile::class, $ instance = $ factory ->createUploadedFile (new FakeStream ()));
@@ -82,7 +82,7 @@ public function testUploadedFileFactory()
82
82
$ this ->assertEquals (NonSAPIUploadedFile::class, get_class ($ instance ));
83
83
}
84
84
85
- public function testUnreadableFileStream_ThrowsException ()
85
+ public function test_UnreadableFileStream_ThrowsException ()
86
86
{
87
87
$ stream = new FakeStream ();
88
88
$ stream ->readable = false ;
@@ -92,13 +92,13 @@ public function testUnreadableFileStream_ThrowsException()
92
92
$ factory ->createUploadedFile ($ stream );
93
93
}
94
94
95
- public function testUriFactory ()
95
+ public function test_UriFactory ()
96
96
{
97
97
$ factory = new Factory \UriFactory ();
98
98
$ this ->assertInstanceOf (Uri::class, $ factory ->createUri ('https://www.example.com ' ));
99
99
}
100
100
101
- public function testMalformedUri_ThrowsException ()
101
+ public function test_MalformedUri_ThrowsException ()
102
102
{
103
103
$ factory = new Factory \UriFactory ();
104
104
$ this ->expectException (InvalidArgumentException::class);
0 commit comments