Skip to content

Commit 596901b

Browse files
authored
Update static tools (#1131)
1 parent 9efabc0 commit 596901b

File tree

2 files changed

+2
-21
lines changed

2 files changed

+2
-21
lines changed

src/Credentials/DateFromResult.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff 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

tests/Unit/Credentials/DateFromResultTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff 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)

0 commit comments

Comments
 (0)