diff options
author | Robin Appelman <robin@icewind.nl> | 2017-10-03 16:27:26 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-10-03 16:27:26 +0200 |
commit | 7525c387ce2fd14cb007b434e93c415902d399db (patch) | |
tree | fd0e0e369ecaace93699c064a807c9eac0995f4a /tests/lib/Repair | |
parent | 7bac8a32b4e2dc41bd81445330acce82e0456a99 (diff) | |
download | nextcloud-server-7525c387ce2fd14cb007b434e93c415902d399db.tar.gz nextcloud-server-7525c387ce2fd14cb007b434e93c415902d399db.zip |
dont run invalid path repair step when upgrading from 11.0.5.2 and later
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/Repair')
-rw-r--r-- | tests/lib/Repair/RepairInvalidPathsTest.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/lib/Repair/RepairInvalidPathsTest.php b/tests/lib/Repair/RepairInvalidPathsTest.php index b0370f5ae2d..17c584fd149 100644 --- a/tests/lib/Repair/RepairInvalidPathsTest.php +++ b/tests/lib/Repair/RepairInvalidPathsTest.php @@ -186,4 +186,34 @@ class RepairInvalidPathsTest extends TestCase { $this->assertEquals($folderId, $this->cache2->get('foo2/bar/asd')['parent']); $this->assertEquals($folderId, $this->cache2->getId('foo2/bar')); } + + public function shouldRunDataProvider() { + return [ + ['11.0.0.0', true], + ['11.0.0.31', true], + ['11.0.5.2', false], + ['12.0.0.0', true], + ['12.0.0.1', true], + ['12.0.0.31', false], + ['13.0.0.0', true], + ['13.0.0.1', false] + ]; + } + + /** + * @dataProvider shouldRunDataProvider + * + * @param string $from + * @param boolean $expected + */ + public function testShouldRun($from, $expected) { + $config = $this->createMock(IConfig::class); + $config->expects($this->any()) + ->method('getSystemValue') + ->with('version', '0.0.0') + ->willReturn($from); + $repair = new RepairInvalidPaths(\OC::$server->getDatabaseConnection(), $config); + + $this->assertEquals($expected, $this->invokePrivate($repair, 'shouldRun')); + } } |