Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorVictor Dubiniuk <victor.dubiniuk@gmail.com>2016-03-25 13:22:22 +0300
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>2016-04-05 17:13:31 +0300
commit118c39d4722b52b5024cc4efa588fe2bfe7577a7 (patch)
tree5705091765ccc08108948e0b0b1d68ab9926cfdd /tests
parentb05269826a64f9a45dd84c29b6d76884c9dff2f3 (diff)
Show cli notice for big installations
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/releasenotes.php53
1 files changed, 34 insertions, 19 deletions
diff --git a/tests/lib/releasenotes.php b/tests/lib/releasenotes.php
index 8219c6194d3..ca2c3db66fb 100644
--- a/tests/lib/releasenotes.php
+++ b/tests/lib/releasenotes.php
@@ -32,24 +32,31 @@ class Test_ReleaseNotes extends \Test\TestCase {
}
public function resultProvider82to90(){
+ $l10n = \OC::$server->getL10N('core');
+ $alterTableMessage = $l10n->t(
+ "Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;",
+ ['ocx_filecache']
+ );
+ $useCliMessage = $l10n->t(
+ "You have an ownCloud installation with over 200.000 files so the upgrade might take a while. The recommendation is to use the command-line instead of the web interface for big ownCloud servers."
+ );
return [
- [ [], false, 20 ],
- [ [], false, 1000000 ],
- [ [], true, 20 ],
- [ [
- \OC::$server->getL10N('core')->t(
- "You have an ownCloud installation with over 200.000 files so the upgrade might take a while. Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE %s ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;",
- ['ocx_filecache']
- )
- ], true, 1000000 ],
+ [ [], false, false, 20 ],
+ [ [], false, true, 20 ],
+ [ [], true, false, 20 ],
+ [ [], true, true, 20 ],
+ [ [ $useCliMessage ], false, false, 1000000 ],
+ [ [], false, true, 1000000 ],
+ [ [ $useCliMessage, $alterTableMessage ], true, false, 1000000 ],
+ [ [ $alterTableMessage ], true, true, 1000000 ],
];
}
/**
* @dataProvider resultProvider82to90
*/
- public function test82to90($expected, $isMysql, $fileCount){
- $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $fileCount);
+ public function test82to90($expected, $isMysql, $isCliMode, $fileCount){
+ $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $isCliMode, $fileCount);
$actual = $releaseNotesMock->getReleaseNotes('8.2.22', '9.0.1');
$this->assertEquals($expected, $actual);
}
@@ -58,24 +65,28 @@ class Test_ReleaseNotes extends \Test\TestCase {
public function resultProvider90to91(){
return [
- [ [], false, 20 ],
- [ [], false, 1000000 ],
- [ [], true, 20 ],
- [ [], true, 1000000 ],
+ [ [], false, false, 20 ],
+ [ [], false, true, 20 ],
+ [ [], true, false, 20 ],
+ [ [], true, true, 20 ],
+ [ [], false, false, 1000000 ],
+ [ [], false, true, 1000000 ],
+ [ [], true, false, 1000000 ],
+ [ [], true, true, 1000000 ],
];
}
/**
* @dataProvider resultProvider90to91
*/
- public function test90to91($expected, $isMysql, $fileCount){
- $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $fileCount);
+ public function test90to91($expected, $isMysql, $isCliMode, $fileCount){
+ $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $isCliMode, $fileCount);
$actual = $releaseNotesMock->getReleaseNotes('9.0.1', '9.1.0');
$this->assertEquals($expected, $actual);
}
- private function getReleaseNotesMock($isMysql, $fileCount){
+ private function getReleaseNotesMock($isMysql, $isCliMode, $fileCount){
$dbConnectionMock = $this->getMockBuilder('OCP\IDBConnection')
->setMethods(array_merge($this->getMethods('OCP\IDBConnection'), ['getPrefix']))
->getMock()
@@ -86,7 +97,7 @@ class Test_ReleaseNotes extends \Test\TestCase {
;
$releaseNotesMock = $this->getMockBuilder('OC\ReleaseNotes')
->setConstructorArgs([$dbConnectionMock])
- ->setMethods(['isMysql', 'countFilecacheEntries'])
+ ->setMethods(['isMysql', 'isCliMode', 'countFilecacheEntries'])
->getMock()
;
@@ -95,6 +106,10 @@ class Test_ReleaseNotes extends \Test\TestCase {
->willReturn($isMysql)
;
$releaseNotesMock->expects($this->any())
+ ->method('isCliMode')
+ ->willReturn($isCliMode)
+ ;
+ $releaseNotesMock->expects($this->any())
->method('countFilecacheEntries')
->willReturn($fileCount)
;