Skip to content
This repository was archived by the owner on Mar 26, 2021. It is now read-only.

Commit 2751239

Browse files
committed
Add report creation date to end of markdown file
1 parent ee4e779 commit 2751239

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Markdown.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace hollodotme\PHPUnit\TestListeners\TestDox;
44

5+
use DateTimeImmutable;
56
use hollodotme\PHPUnit\TestListeners\TestDox\Exceptions\RuntimeException;
67
use hollodotme\PHPUnit\TestListeners\TestDox\Interfaces\WritesMarkdownFile;
78
use hollodotme\PHPUnit\TestListeners\TestDox\Output\MarkdownFile;
@@ -338,8 +339,19 @@ private function getTestResultInfo( string $testNameWithDataSet, string $result,
338339
];
339340
}
340341

342+
/**
343+
* @throws RuntimeException
344+
* @throws \Exception
345+
*/
341346
public function __destruct()
342347
{
348+
$dateTime = new DateTimeImmutable();
349+
$this->markdownFile->write(
350+
'Report created at %s (%s)',
351+
$dateTime->format( 'Y-m-d H:i:s' ),
352+
$dateTime->getTimezone()->getName()
353+
);
354+
343355
$filePath = $this->markdownFile->getFilePath();
344356
$this->markdownFile->close();
345357

0 commit comments

Comments
 (0)