mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
code style in FileLog and FileLogTest
This commit is contained in:
parent
278700677a
commit
5b5180f661
2 changed files with 5 additions and 4 deletions
|
@ -145,11 +145,12 @@ class FileLog extends BaseLog {
|
|||
static $selfError = false;
|
||||
if (!$selfError && !$exists && !chmod($pathname, (int)$this->_config['mask'])) {
|
||||
$selfError = true;
|
||||
trigger_error(__d(
|
||||
trigger_error(__d(
|
||||
'cake_dev', 'Could not apply permission mask "%s" on log file "%s"',
|
||||
array($pathname, $this->_config['mask'])), E_USER_WARNING);
|
||||
$selfError = false;
|
||||
}
|
||||
return $r;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -158,21 +158,21 @@ class FileLogTest extends CakeTestCase {
|
|||
|
||||
$log = new FileLog(array('path' => $path, 'mask' => 0666));
|
||||
$log->write('warning', 'Test warning one');
|
||||
$result = substr(sprintf('%o',fileperms($path . 'error.log')), -4);
|
||||
$result = substr(sprintf('%o', fileperms($path . 'error.log')), -4);
|
||||
$expected = '0666';
|
||||
$this->assertEquals($expected, $result);
|
||||
unlink($path . 'error.log');
|
||||
|
||||
$log = new FileLog(array('path' => $path, 'mask' => 0644));
|
||||
$log->write('warning', 'Test warning two');
|
||||
$result = substr(sprintf('%o',fileperms($path . 'error.log')), -4);
|
||||
$result = substr(sprintf('%o', fileperms($path . 'error.log')), -4);
|
||||
$expected = '0644';
|
||||
$this->assertEquals($expected, $result);
|
||||
unlink($path . 'error.log');
|
||||
|
||||
$log = new FileLog(array('path' => $path, 'mask' => 0640));
|
||||
$log->write('warning', 'Test warning three');
|
||||
$result = substr(sprintf('%o',fileperms($path . 'error.log')), -4);
|
||||
$result = substr(sprintf('%o', fileperms($path . 'error.log')), -4);
|
||||
$expected = '0640';
|
||||
$this->assertEquals($expected, $result);
|
||||
unlink($path . 'error.log');
|
||||
|
|
Loading…
Reference in a new issue