]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - tests/utils/ReferenceHistory.php
4 * Populates a reference history
10 private $history = [];
13 * Populates the test DB with reference data
15 public function __construct()
19 DateTime
::createFromFormat('Ymd_His', '20170303_121216'),
25 DateTime
::createFromFormat('Ymd_His', '20170302_121215')
30 DateTime
::createFromFormat('Ymd_His', '20170301_121214'),
36 DateTime
::createFromFormat('Ymd_His', '20170201_121214'),
42 DateTime
::createFromFormat('Ymd_His', '20170101_121212'),
48 * Adds a new history entry
50 * @param string $event Event identifier
51 * @param DateTime $datetime creation date
52 * @param int $id optional: related link ID
54 protected function addEntry($event, $datetime, $id = null)
58 'datetime' => $datetime,
61 $this->history
[] = $link;
66 * Writes data to the datastore
68 * @param string $filename write history content to.
70 public function write($filename)
72 FileUtils
::writeFlatDB($filename, $this->history
);
76 * Returns the number of links in the reference data
78 public function count()