]>
git.immae.eu Git - github/shaarli/Shaarli.git/blob - tests/utils/ReferenceHistory.php
7 * Populates a reference history
13 private $history = [];
16 * Populates the test DB with reference data
18 public function __construct()
22 DateTime
::createFromFormat('Ymd_His', '20170303_121216'),
28 DateTime
::createFromFormat('Ymd_His', '20170302_121215')
33 DateTime
::createFromFormat('Ymd_His', '20170301_121214'),
39 DateTime
::createFromFormat('Ymd_His', '20170201_121214'),
45 DateTime
::createFromFormat('Ymd_His', '20170101_121212'),
51 * Adds a new history entry
53 * @param string $event Event identifier
54 * @param DateTime $datetime creation date
55 * @param int $id optional: related link ID
57 protected function addEntry($event, $datetime, $id = null)
61 'datetime' => $datetime,
64 $this->history
[] = $link;
69 * Writes data to the datastore
71 * @param string $filename write history content to.
73 public function write($filename)
75 FileUtils
::writeFlatDB($filename, $this->history
);
79 * Returns the number of links in the reference data
81 public function count()