/** * @param string $dbCode * @param array $stat * @param string|null $stateCode * @param string|array|bool $result * @dataProvider getDbFileStatDataProvider */ public function testGetDbFileStat($dbCode, $stat, $stateCode, $result) { $this->configureDirectoryIsFileIsReadableMethods($dbCode, true, true); $dbPath = $this->getDbPathNonAbsolute($dbCode); if ($dbPath) { $this->directory->expects($this->once())->method('stat')->with($dbPath)->willReturn($stat); } $this->assertEquals($result, $this->database->getDbFileStat($dbCode, $stateCode)); }
/** * @param string $dbCode * @return \DateTime */ protected function getDbDateTime($dbCode) { $dateTime = new \DateTime(); $dateTime->setTimestamp($this->database->getDbFileStat($dbCode, 'mtime')); return $dateTime; }