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
11
11
{
12
12
private function getDateFromResult (Result $ result ): ?\DateTimeImmutable
13
13
{
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 ) {
18
16
return new \DateTimeImmutable ($ date );
19
17
}
20
18
Original file line number Diff line number Diff line change @@ -32,23 +32,6 @@ public function testWithValidDate()
32
32
self ::assertEquals ($ time , $ output ->format ('Y-m-d H:i:s ' ));
33
33
}
34
34
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
-
52
35
public function testWithNoDate ()
53
36
{
54
37
$ httpResponse = $ this ->getMockBuilder (MockResponse::class)
You can’t perform that action at this time.
0 commit comments