@@ -18,7 +18,7 @@ public function tearDown()
1818 Mockery::close ();
1919 }
2020
21- public function testUrlGetter ()
21+ public function test_url_getter ()
2222 {
2323 $ this ->requester ->url ('example.com ' );
2424
@@ -33,19 +33,19 @@ public function testUrlGetter()
3333 $ this ->assertEquals ('git://example.com ' , $ this ->requester ->getUrl ());
3434 }
3535
36- public function testInvalidUrlException ()
36+ public function test_invalid_url_exception ()
3737 {
3838 $ this ->setExpectedException ('PulkitJalan\Requester\Exceptions\InvalidUrlException ' );
3939
4040 $ this ->requester ->getUrl ();
4141 }
4242
43- public function testGuzzleGetter ()
43+ public function test_guzzle_getter ()
4444 {
4545 $ this ->assertInstanceOf ('GuzzleHttp\Client ' , $ this ->requester ->getGuzzleClient ());
4646 }
4747
48- public function testDisablingSslVerification ()
48+ public function test_disabling_ssl_verification ()
4949 {
5050 $ this ->guzzle ->shouldReceive ('get ' )->once ()->with ('https://example.com ' , [
5151 'verify ' => false ,
@@ -54,7 +54,7 @@ public function testDisablingSslVerification()
5454 $ this ->requester ->url ('example.com ' )->verify (false )->get ();
5555 }
5656
57- public function testSettingAsync ()
57+ public function test_setting_async ()
5858 {
5959 $ this ->guzzle ->shouldReceive ('get ' )->once ()->with ('https://example.com ' , [
6060 'verify ' => true ,
@@ -64,7 +64,7 @@ public function testSettingAsync()
6464 $ this ->requester ->url ('example.com ' )->async (true )->get ();
6565 }
6666
67- public function testSettingAndAddingHeaders ()
67+ public function test_setting_and_adding_headers ()
6868 {
6969 $ this ->requester ->headers (['Authorization ' => 'Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== ' ]);
7070
@@ -84,7 +84,7 @@ public function testSettingAndAddingHeaders()
8484 ], $ this ->readAttribute ($ this ->requester , 'options ' ));
8585 }
8686
87- public function testAddingFileToRequest ()
87+ public function test_adding_file_to_request ()
8888 {
8989 $ this ->requester ->addFile (__FILE__ );
9090
@@ -97,7 +97,7 @@ public function testAddingFileToRequest()
9797 $ this ->assertInternalType ('resource ' , $ this ->readAttribute ($ this ->requester , 'options ' )['body ' ]['image ' ]);
9898 }
9999
100- public function testChangingRetryOptions ()
100+ public function test_changing_retry_options ()
101101 {
102102 $ this ->requester ->retry (10 );
103103
@@ -116,7 +116,22 @@ public function testChangingRetryOptions()
116116 $ this ->assertEquals (false , $ this ->readAttribute ($ this ->requester , 'retry ' ));
117117 }
118118
119- public function testSendingGetRequest ()
119+ public function test_adding_logger ()
120+ {
121+ $ monolog = new \Monolog \Logger ('name ' );
122+ $ handler = Mockery::mock ('Monolog\Handler\NullHandler ' )->makePartial ();
123+ $ monolog ->pushHandler ($ handler );
124+
125+ $ requester = new \PulkitJalan \Requester \Requester (new \GuzzleHttp \Client ());
126+
127+ $ requester ->addLogger ($ monolog );
128+
129+ $ handler ->shouldReceive ('handle ' )->once ();
130+
131+ $ requester ->url ('example.com ' )->get ();
132+ }
133+
134+ public function test_sending_get_request ()
120135 {
121136 $ this ->guzzle ->shouldReceive ('get ' )->once ()->with ('https://example.com ' , [
122137 'verify ' => true ,
@@ -125,7 +140,7 @@ public function testSendingGetRequest()
125140 $ this ->requester ->url ('example.com ' )->get ();
126141 }
127142
128- public function testSendingHeadRequest ()
143+ public function test_sending_head_request ()
129144 {
130145 $ this ->guzzle ->shouldReceive ('head ' )->once ()->with ('https://example.com ' , [
131146 'verify ' => true ,
@@ -134,7 +149,7 @@ public function testSendingHeadRequest()
134149 $ this ->requester ->url ('example.com ' )->head ();
135150 }
136151
137- public function testSendingOptionsRequest ()
152+ public function test_sending_options_request ()
138153 {
139154 $ this ->guzzle ->shouldReceive ('options ' )->once ()->with ('https://example.com ' , [
140155 'verify ' => true ,
@@ -143,7 +158,7 @@ public function testSendingOptionsRequest()
143158 $ this ->requester ->url ('example.com ' )->options ();
144159 }
145160
146- public function testSendingPostRequest ()
161+ public function test_sending_post_request ()
147162 {
148163 $ this ->guzzle ->shouldReceive ('post ' )->once ()->with ('https://example.com ' , [
149164 'verify ' => true ,
@@ -159,7 +174,7 @@ public function testSendingPostRequest()
159174 ]);
160175 }
161176
162- public function testSendingPutRequest ()
177+ public function test_sending_put_request ()
163178 {
164179 $ this ->guzzle ->shouldReceive ('put ' )->once ()->with ('https://example.com ' , [
165180 'verify ' => true ,
@@ -175,7 +190,7 @@ public function testSendingPutRequest()
175190 ]);
176191 }
177192
178- public function testSendingPatchRequest ()
193+ public function test_sending_patch_request ()
179194 {
180195 $ this ->guzzle ->shouldReceive ('patch ' )->once ()->with ('https://example.com ' , [
181196 'verify ' => true ,
@@ -191,7 +206,7 @@ public function testSendingPatchRequest()
191206 ]);
192207 }
193208
194- public function testSendingDeleteRequest ()
209+ public function test_sending_delete_request ()
195210 {
196211 $ this ->guzzle ->shouldReceive ('delete ' )->once ()->with ('https://example.com ' , [
197212 'verify ' => true ,
0 commit comments