mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 18:33:13 +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 = '')
|
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
|
* @param string $version
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getPath($version);
|
public function getPath($version = '');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the content of a logfile.
|
* Returns the content of a logfile.
|
||||||
@@ -36,7 +36,7 @@ interface LogFileInterface
|
|||||||
* @param string $version
|
* @param string $version
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getContent($version);
|
public function getContent($version = '');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Streams the content of a logfile.
|
* Streams the content of a logfile.
|
||||||
@@ -46,14 +46,14 @@ interface LogFileInterface
|
|||||||
* @param string $version
|
* @param string $version
|
||||||
* @return Closure
|
* @return Closure
|
||||||
*/
|
*/
|
||||||
public function getContentStream($version);
|
public function getContentStream($version = '');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clears the content of a logfile.
|
* Clears the content of a logfile.
|
||||||
*
|
*
|
||||||
* @param string $version
|
* @param string $version
|
||||||
*/
|
*/
|
||||||
public function clear($version);
|
public function clear($version = '');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the logfile exists
|
* Returns true if the logfile exists
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ abstract class LogFileTestCase extends \PhraseanetTestCase
|
|||||||
$log = $this->getLogFile($this->root);
|
$log = $this->getLogFile($this->root);
|
||||||
file_put_contents($log->getPath(), 'hello world');
|
file_put_contents($log->getPath(), 'hello world');
|
||||||
$log->clear();
|
$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