diff options
author | Robin Appelman <robin@icewind.nl> | 2016-11-21 14:14:20 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-11-21 15:59:08 +0100 |
commit | 0048b3aa2e70b2e9d2f1fbb6adb82af31b13f95a (patch) | |
tree | 619e52b1dd2975619a64a021dc57c626223650d3 /tests/lib/Settings/Admin | |
parent | c694bd34551affce44418541a3d1121c0dd04f2c (diff) | |
download | nextcloud-server-0048b3aa2e70b2e9d2f1fbb6adb82af31b13f95a.tar.gz nextcloud-server-0048b3aa2e70b2e9d2f1fbb6adb82af31b13f95a.zip |
update tests
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'tests/lib/Settings/Admin')
-rw-r--r-- | tests/lib/Settings/Admin/LoggingTest.php | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/tests/lib/Settings/Admin/LoggingTest.php b/tests/lib/Settings/Admin/LoggingTest.php deleted file mode 100644 index 181553d3894..00000000000 --- a/tests/lib/Settings/Admin/LoggingTest.php +++ /dev/null @@ -1,91 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016 Lukas Reschke <lukas@statuscode.ch> - * - * @author Lukas Reschke <lukas@statuscode.ch> - * - * @license GNU AGPL version 3 or any later version - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ - -namespace Test\Settings\Admin; - -use OC\Settings\Admin\Logging; -use OCP\AppFramework\Http\TemplateResponse; -use OCP\IConfig; -use Test\TestCase; -use OC\Log\File as LogFile; - -class LoggingTest extends TestCase { - /** @var Logging */ - private $admin; - /** @var IConfig */ - private $config; - - public function setUp() { - parent::setUp(); - $this->config = $this->getMockBuilder('\OCP\IConfig')->getMock(); - - $this->admin = new Logging( - $this->config - ); - } - - public function testGetForm() { - $this->config - ->expects($this->at(0)) - ->method('getSystemValue') - ->with('log_type', 'file') - ->willReturn('owncloud'); - $this->config - ->expects($this->at(1)) - ->method('getSystemValue') - ->with('loglevel', 2) - ->willReturn(3); - - $numEntriesToLoad = 5; - $entries = LogFile::getEntries($numEntriesToLoad + 1); - $entriesRemaining = count($entries) > $numEntriesToLoad; - $entries = array_slice($entries, 0, $numEntriesToLoad); - - $logFileExists = file_exists(LogFile::getLogFilePath()) ; - $logFileSize = $logFileExists ? filesize(LogFile::getLogFilePath()) : 0; - - $expected = new TemplateResponse( - 'settings', - 'admin/logging', - [ - 'loglevel' => 3, - 'entries' => $entries, - 'entriesremain' => $entriesRemaining, - 'doesLogFileExist' => $logFileExists, - 'logFileSize' => $logFileSize, - 'showLog' => true, - ], - '' - ); - - $this->assertEquals($expected, $this->admin->getForm()); - } - - public function testGetSection() { - $this->assertSame('logging', $this->admin->getSection()); - } - - public function testGetPriority() { - $this->assertSame(0, $this->admin->getPriority()); - } -} |