diff options
author | Matthias Held <ilovemilk@wusa.io> | 2020-12-17 20:51:57 +0300 |
---|---|---|
committer | Matthias Held <ilovemilk@wusa.io> | 2020-12-17 20:51:57 +0300 |
commit | e1c9edb29b411788f1872f09668a763c68e406d8 (patch) | |
tree | 7b4f7cca16f2a83d4199b6340cd726b5949608f4 | |
parent | d44be34f075dd6d7372e1d0e114dcc8e7c759e6d (diff) |
fix tests
-rw-r--r-- | tests/Unit/MonitorTest.php | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/tests/Unit/MonitorTest.php b/tests/Unit/MonitorTest.php index 296fa3a..c833933 100644 --- a/tests/Unit/MonitorTest.php +++ b/tests/Unit/MonitorTest.php @@ -254,92 +254,6 @@ class MonitorTest extends TestCase $this->assertTrue(true); } - public function dataGetFileSize() - { - return [ - ['path' => '/files_trashbin/test.jpg', 'size' => 10], - ['path' => '/files/test.jpg', 'size' => 10], - ]; - } - - /** - * @dataProvider dataGetFileSize - * - * @param string $path - * @param int $size - */ - public function testGetFileSize($path, $size) - { - $getFileSize = self::getMethod('getFileSize'); - - $monitor = new Monitor($this->request, $this->config, $this->time, - $this->appManager, $this->logger, $this->rootFolder, - $this->entropyAnalyzer, $this->mapper, $this->fileExtensionAnalyzer, - $this->fileCorruptionAnalyzer, $this->userId); - - $node = $this->createMock(File::class); - $node->method('getSize') - ->willReturn($size); - - $this->rootFolder->method('get') - ->willReturn($node); - - $folder = $this->createMock(Folder::class); - $userRoot = $this->createMock(Folder::class); - $folder->method('getParent') - ->willReturn($userRoot); - - $userRoot->method('get') - ->willReturn($node); - - $this->rootFolder->method('getUserFolder') - ->willReturn($folder); - - $this->assertEquals($getFileSize->invokeArgs($monitor, [$path]), $size); - } - - public function dataGetFileSizeNotFoundException() - { - return [ - ['path' => '/files_trashbin/test.jpg'], - ['path' => '/files/test.jpg'], - ]; - } - - /** - * @expectedException OCP\Files\NotFoundException - * @dataProvider dataGetFileSizeNotFoundException - * - * @param string $path - */ - public function testGetFileSizeNotFoundException($path) - { - $getFileSize = self::getMethod('getFileSize'); - - $monitor = new Monitor($this->request, $this->config, $this->time, - $this->appManager, $this->logger, $this->rootFolder, - $this->entropyAnalyzer, $this->mapper, $this->fileExtensionAnalyzer, - $this->fileCorruptionAnalyzer, $this->userId); - - $node = $this->createMock(Folder::class); - - $this->rootFolder->method('get') - ->willReturn($node); - - $folder = $this->createMock(Folder::class); - $userRoot = $this->createMock(Folder::class); - $folder->method('getParent') - ->willReturn($userRoot); - - $userRoot->method('get') - ->willReturn($node); - - $this->rootFolder->method('getUserFolder') - ->willReturn($folder); - - $getFileSize->invokeArgs($monitor, [$path]); - } - public function dataIsUploadedFile() { return [ |