Fix getMock QuotaTest
This commit is contained in:
parent
fe15dccb45
commit
d277053f22
|
@ -10,6 +10,7 @@ namespace Test\Files\Storage\Wrapper;
|
||||||
|
|
||||||
//ensure the constants are loaded
|
//ensure the constants are loaded
|
||||||
use OC\Files\Cache\CacheEntry;
|
use OC\Files\Cache\CacheEntry;
|
||||||
|
use OC\Files\Storage\Local;
|
||||||
|
|
||||||
\OC::$loader->load('\OC\Files\Filesystem');
|
\OC::$loader->load('\OC\Files\Filesystem');
|
||||||
|
|
||||||
|
@ -75,11 +76,10 @@ class QuotaTest extends \Test\Files\Storage\Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testFreeSpaceWithUnknownDiskSpace() {
|
public function testFreeSpaceWithUnknownDiskSpace() {
|
||||||
$storage = $this->getMock(
|
$storage = $this->getMockBuilder(Local::class)
|
||||||
'\OC\Files\Storage\Local',
|
->setMethods(['free_space'])
|
||||||
array('free_space'),
|
->setConstructorArgs([['datadir' => $this->tmpDir]])
|
||||||
array(array('datadir' => $this->tmpDir))
|
->getMock();
|
||||||
);
|
|
||||||
$storage->expects($this->any())
|
$storage->expects($this->any())
|
||||||
->method('free_space')
|
->method('free_space')
|
||||||
->will($this->returnValue(-2));
|
->will($this->returnValue(-2));
|
||||||
|
@ -132,10 +132,10 @@ class QuotaTest extends \Test\Files\Storage\Storage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testReturnFalseWhenFopenFailed() {
|
public function testReturnFalseWhenFopenFailed() {
|
||||||
$failStorage = $this->getMock(
|
$failStorage = $this->getMockBuilder(Local::class)
|
||||||
'\OC\Files\Storage\Local',
|
->setMethods(['fopen'])
|
||||||
array('fopen'),
|
->setConstructorArgs([['datadir' => $this->tmpDir]])
|
||||||
array(array('datadir' => $this->tmpDir)));
|
->getMock();
|
||||||
$failStorage->expects($this->any())
|
$failStorage->expects($this->any())
|
||||||
->method('fopen')
|
->method('fopen')
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
|
|
Loading…
Reference in New Issue