namespace Test;
use OC\Log;
+use OCP\IConfig;
class NullLogger extends Log {
public function __construct($logger = null) {
$logger = new NullLogger();
}
if (!$config) {
- $config = $this->getMock('\OCP\IConfig');
+ $config = $this->createMock(IConfig::class);
$config->method('getSystemValue')
->with('tempdirectory', null)
->willReturn('/tmp');
public function testLogCantCreateFile() {
$this->markTestSkipped('TODO: Disable because fails on drone');
- $logger = $this->getMock('\Test\NullLogger');
+ $logger = $this->createMock(NullLogger::class);
$manager = $this->getManager($logger);
chmod($this->baseDir, 0500);
$logger->expects($this->once())
public function testLogCantCreateFolder() {
$this->markTestSkipped('TODO: Disable because fails on drone');
- $logger = $this->getMock('\Test\NullLogger');
+ $logger = $this->createMock(NullLogger::class);
$manager = $this->getManager($logger);
chmod($this->baseDir, 0500);
$logger->expects($this->once())
}
public function testBuildFileNameWithPostfix() {
- $logger = $this->getMock('\Test\NullLogger');
+ $logger = $this->createMock(NullLogger::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
'buildFileNameWithSuffix',
}
public function testBuildFileNameWithoutPostfix() {
- $logger = $this->getMock('\Test\NullLogger');
+ $logger = $this->createMock(NullLogger::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
'buildFileNameWithSuffix',
}
public function testBuildFileNameWithSuffixPathTraversal() {
- $logger = $this->getMock('\Test\NullLogger');
+ $logger = $this->createMock(NullLogger::class);
$tmpManager = self::invokePrivate(
$this->getManager($logger),
'buildFileNameWithSuffix',
public function testGetTempBaseDirFromConfig() {
$dir = $this->getManager()->getTemporaryFolder();
- $config = $this->getMock('\OCP\IConfig');
+ $config = $this->createMock(IConfig::class);
$config->expects($this->once())
->method('getSystemValue')
->with('tempdirectory', null)