File tree Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,8 @@ trait DateFromResult
1111{
1212 private function getDateFromResult (Result $ result ): ?\DateTimeImmutable
1313 {
14- if (
15- (null !== $ response = $ result ->info ()['response ' ] ?? null ) &&
16- (null !== $ date = $ response ->getHeaders (false )['date ' ][0 ] ?? null )
17- ) {
14+ $ response = $ result ->info ()['response ' ];
15+ if (null !== $ date = $ response ->getHeaders (false )['date ' ][0 ] ?? null ) {
1816 return new \DateTimeImmutable ($ date );
1917 }
2018
Original file line number Diff line number Diff line change @@ -32,23 +32,6 @@ public function testWithValidDate()
3232 self ::assertEquals ($ time , $ output ->format ('Y-m-d H:i:s ' ));
3333 }
3434
35- public function testWithNoResponse ()
36- {
37- $ response = $ this ->getMockBuilder (Response::class)
38- ->disableOriginalConstructor ()
39- ->onlyMethods (['info ' , 'resolve ' ])
40- ->getMock ();
41-
42- $ response ->expects (self ::once ())
43- ->method ('info ' )
44- ->willReturn ([]);
45-
46- $ result = new DummyResult ($ response );
47-
48- $ output = (new DummyCredentials ())->expose ($ result );
49- self ::assertNull ($ output );
50- }
51-
5235 public function testWithNoDate ()
5336 {
5437 $ httpResponse = $ this ->getMockBuilder (MockResponse::class)
You can’t perform that action at this time.
0 commit comments