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
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-04-06 16:51:25 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2016-04-06 16:51:25 +0300
commitc43713515b7615cd34b695327e8b246d9de6d800 (patch)
tree7e16597108004794503e4b743ec4744a4d2c068d
parente5bec54e4e746364b621a4d26e400f7178c9c62f (diff)
Remove duplicated message
-rw-r--r--lib/private/releasenotes.php21
-rw-r--r--tests/lib/releasenotestest.php44
2 files changed, 19 insertions, 46 deletions
diff --git a/lib/private/releasenotes.php b/lib/private/releasenotes.php
index a7caf8601ae..5da416c19f0 100644
--- a/lib/private/releasenotes.php
+++ b/lib/private/releasenotes.php
@@ -28,11 +28,11 @@ use OCP\IDBConnection;
* Class to store release notes
*/
class ReleaseNotes {
- /** @var \OCP\IDBConnection $dbConnection */
+ /** @var IDBConnection $dbConnection */
protected $dbConnection;
/**
- * @param \OCP\IDBConnection $dbConnection
+ * @param IDBConnection $dbConnection
*/
public function __construct(IDBConnection $dbConnection) {
$this->dbConnection = $dbConnection;
@@ -60,11 +60,6 @@ class ReleaseNotes {
}
if ($fromVersionMajorMinor === '8.2' && $toVersionMajorMinor === '9.0') {
- if (!$this->isCliMode() && $this->countFilecacheEntries() > 200000) {
- $releaseNotes[] = $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.'
- );
- }
if ($this->isMysql() && $this->countFilecacheEntries() > 200000) {
$releaseNotes[] = $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;',
@@ -74,14 +69,7 @@ class ReleaseNotes {
}
return $releaseNotes;
}
-
- /**
- * @return bool
- */
- protected function isCliMode() {
- return \OC::$CLI;
- }
-
+
/**
* @return bool
*/
@@ -109,10 +97,11 @@ class ReleaseNotes {
* Strip everything except first digits
* @param string $version
* @return string
+ * @throws \InvalidArgumentException
*/
private function getMajorMinor($version){
$versionArray = explode('.', $version);
- if ( count($versionArray)<2 ) {
+ if (count($versionArray) < 2) {
throw new \InvalidArgumentException('Version should have at least 2 parts separated by dot.');
}
return implode('.', [ $versionArray[0], $versionArray[1] ]);
diff --git a/tests/lib/releasenotestest.php b/tests/lib/releasenotestest.php
index aaa47bb2481..584f396038b 100644
--- a/tests/lib/releasenotestest.php
+++ b/tests/lib/releasenotestest.php
@@ -25,11 +25,10 @@ class ReleaseNotesTest extends \Test\TestCase {
/**
* @param bool $isMysql
- * @param bool $isCliMode
* @param int $fileCount
* @return \PHPUnit_Framework_MockObject_MockObject|\OC\ReleaseNotes
*/
- protected function getReleaseNotesMock($isMysql, $isCliMode, $fileCount) {
+ protected function getReleaseNotesMock($isMysql, $fileCount) {
$query = $this->getMockBuilder('OCP\DB\QueryBuilder\IQueryBuilder')
->disableOriginalConstructor()
->getMock();
@@ -47,33 +46,24 @@ class ReleaseNotesTest extends \Test\TestCase {
->willReturn($query);
$releaseNotesMock = $this->getMockBuilder('OC\ReleaseNotes')
->setConstructorArgs([$dbConnectionMock])
- ->setMethods(['isMysql', 'isCliMode', 'countFilecacheEntries'])
+ ->setMethods(['isMysql', 'countFilecacheEntries'])
->getMock();
$releaseNotesMock->expects($this->any())
->method('isMysql')
->willReturn($isMysql);
$releaseNotesMock->expects($this->any())
- ->method('isCliMode')
- ->willReturn($isCliMode);
- $releaseNotesMock->expects($this->any())
->method('countFilecacheEntries')
->willReturn($fileCount);
return $releaseNotesMock;
}
public function data82to90() {
- $alterTableMessage = 'Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE ocx_filecache ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;';
- $useCliMessage = '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, 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],
+ [[], false, 20],
+ [[], true, 20],
+ [[], false, 1000000],
+ [['Hint: You can speed up the upgrade by executing this SQL command manually: ALTER TABLE ocx_filecache ADD COLUMN checksum varchar(255) DEFAULT NULL AFTER permissions;'], true, 1000000],
];
}
@@ -82,25 +72,20 @@ class ReleaseNotesTest extends \Test\TestCase {
*
* @param string[] $expected
* @param bool $isMysql
- * @param bool $isCliMode
* @param int $fileCount
*/
- public function test82to90($expected, $isMysql, $isCliMode, $fileCount) {
- $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $isCliMode, $fileCount);
+ public function test82to90($expected, $isMysql, $fileCount) {
+ $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $fileCount);
$actual = $releaseNotesMock->getReleaseNotes('8.2.22', '9.0.1');
$this->assertEquals($expected, $actual);
}
public function data90to91() {
return [
- [false, false, 20],
- [false, true, 20],
- [true, false, 20],
- [true, true, 20],
- [false, false, 1000000],
- [false, true, 1000000],
- [true, false, 1000000],
- [true, true, 1000000],
+ [false, 20],
+ [true, 20],
+ [false, 1000000],
+ [true, 1000000],
];
}
@@ -108,11 +93,10 @@ class ReleaseNotesTest extends \Test\TestCase {
* @dataProvider data90to91
*
* @param bool $isMysql
- * @param bool $isCliMode
* @param int $fileCount
*/
- public function test90to91($isMysql, $isCliMode, $fileCount) {
- $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $isCliMode, $fileCount);
+ public function test90to91($isMysql, $fileCount) {
+ $releaseNotesMock = $this->getReleaseNotesMock($isMysql, $fileCount);
$actual = $releaseNotesMock->getReleaseNotes('9.0.1', '9.1.0');
$this->assertCount(0, $actual);
}