mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
#PHRAS-846 time 1h
fix test
This commit is contained in:
@@ -66,7 +66,7 @@ abstract class AbstractLogFile implements LogFileInterface
|
||||
*/
|
||||
public function clear($version = '')
|
||||
{
|
||||
file_put_contents($this->getPath($version), sprintf("File cleared %s\n", date('r')));
|
||||
file_put_contents($this->getPath($version), sprintf("[%s] File cleared\n", date(\DateTime::ATOM)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ interface LogFileInterface
|
||||
* @param string $version
|
||||
* @return string
|
||||
*/
|
||||
public function getPath($version);
|
||||
public function getPath($version = '');
|
||||
|
||||
/**
|
||||
* Returns the content of a logfile.
|
||||
@@ -36,7 +36,7 @@ interface LogFileInterface
|
||||
* @param string $version
|
||||
* @return string
|
||||
*/
|
||||
public function getContent($version);
|
||||
public function getContent($version = '');
|
||||
|
||||
/**
|
||||
* Streams the content of a logfile.
|
||||
@@ -46,14 +46,14 @@ interface LogFileInterface
|
||||
* @param string $version
|
||||
* @return Closure
|
||||
*/
|
||||
public function getContentStream($version);
|
||||
public function getContentStream($version = '');
|
||||
|
||||
/**
|
||||
* Clears the content of a logfile.
|
||||
*
|
||||
* @param string $version
|
||||
*/
|
||||
public function clear($version);
|
||||
public function clear($version = '');
|
||||
|
||||
/**
|
||||
* Returns true if the logfile exists
|
||||
|
||||
@@ -60,7 +60,9 @@ abstract class LogFileTestCase extends \PhraseanetTestCase
|
||||
$log = $this->getLogFile($this->root);
|
||||
file_put_contents($log->getPath(), 'hello world');
|
||||
$log->clear();
|
||||
$this->assertSame('', $log->getContent());
|
||||
$matches = [];
|
||||
$this->assertEquals(1, preg_match('/^\[(.*)\] File cleared/', $log->getContent(), $matches));
|
||||
$this->assertDateAtom($matches[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user