Skip to content

Commit e5bb608

Browse files
committed
Fixed tests 1
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent 00111c2 commit e5bb608

5 files changed

Lines changed: 33 additions & 155 deletions

File tree

.drone.yml

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -695,149 +695,8 @@ pipeline:
695695
TEST: memcache-redis-cluster
696696
matrix:
697697
include:
698-
- TESTS: checkers
699-
- TESTS: nodb-codecov
700-
ENABLE_REDIS: true
701-
- TESTS: db-codecov
702-
ENABLE_REDIS: true
703-
- DB: NODB
704-
PHP: 5.6
705-
ENABLE_REDIS: true
706-
- DB: NODB
707-
PHP: 7.0
708-
ENABLE_REDIS: true
709-
- DB: NODB
710-
PHP: 7.1
711-
ENABLE_REDIS: true
712698
- DB: NODB
713-
PHP: 7.2
714-
ENABLE_REDIS: false
715-
- DB: sqlite
716-
PHP: 5.6
717-
ENABLE_REDIS: true
718-
- DB: sqlite
719-
PHP: 7.0
720-
ENABLE_REDIS: true
721-
- DB: sqlite
722-
PHP: 7.1
723-
ENABLE_REDIS: true
724-
- DB: sqlite
725-
PHP: 7.2
726-
ENABLE_REDIS: false
727-
- DB: mysql
728-
PHP: 5.6
729-
ENABLE_REDIS: true
730-
- DB: mysql
731-
PHP: 7.0
732-
ENABLE_REDIS: true
733-
- DB: mysql
734-
PHP: 7.1
735-
ENABLE_REDIS: true
736-
- DB: mysql
737-
PHP: 7.2
738-
ENABLE_REDIS: false
739-
- DB: mysql5.6
740-
PHP: 5.6
741-
ENABLE_REDIS: true
742-
- DB: mysql5.6
743-
PHP: 7.0
744-
ENABLE_REDIS: true
745-
- DB: mysql5.6
746-
PHP: 7.1
747-
ENABLE_REDIS: true
748-
- DB: mysql5.5
749-
PHP: 5.6
750-
ENABLE_REDIS: true
751-
- DB: mysql5.5
752-
PHP: 7.0
753-
ENABLE_REDIS: true
754-
- DB: mysql5.5
755-
PHP: 7.1
756-
ENABLE_REDIS: true
757-
- DB: postgres
758-
PHP: 5.6
759-
POSTGRES: 9
760-
ENABLE_REDIS: true
761-
- DB: postgres
762699
PHP: 7.0
763-
POSTGRES: 9
764-
ENABLE_REDIS: true
765-
- DB: postgres
766-
PHP: 7.1
767-
POSTGRES: 9
768-
ENABLE_REDIS: true
769-
- DB: postgres
770-
PHP: 7.1
771-
POSTGRES: 10
772-
ENABLE_REDIS: true
773-
- DB: mysqlmb4
774-
PHP: 5.6
775-
ENABLE_REDIS: true
776-
- DB: mysqlmb4
777-
PHP: 7.0
778-
ENABLE_REDIS: true
779-
- DB: mysqlmb4
780-
PHP: 7.1
781-
ENABLE_REDIS: true
782-
- DB: mysqlmb4
783-
PHP: 7.2
784-
ENABLE_REDIS: false
785-
- TESTS: integration-capabilities_features
786-
- TESTS: integration-federation_features
787-
- TESTS: integration-maintenance-mode
788-
- TESTS: integration-ratelimiting
789-
ENABLE_REDIS: true
790-
- TESTS: integration-auth
791-
- TESTS: integration-carddav
792-
- TESTS: integration-dav-v2
793-
- TESTS: integration-ocs-v1
794-
- TESTS: integration-sharing-v1
795-
- TESTS: integration-sharing-v1-part2
796-
- TESTS: integration-sharing-v1-part3
797-
- TESTS: integration-checksums
798-
- TESTS: integration-external-storage
799-
- TESTS: integration-provisioning-v1
800-
- TESTS: integration-tags
801-
- TESTS: integration-caldav
802-
- TESTS: integration-comments
803-
- TESTS: integration-favorites
804-
- TESTS: integration-provisioning-v2
805-
- TESTS: integration-webdav-related
806-
- TESTS: integration-sharees-features
807-
- TESTS: integration-sharees-v2-features
808-
- TESTS: integration-setup-features
809-
- TESTS: integration-filesdrop-features
810-
- TESTS: integration-transfer-ownership-features
811-
- TESTS: integration-ldap-features
812-
- TESTS: integration-trashbin
813-
- TESTS: integration-remote-api
814-
- TESTS: acceptance
815-
TESTS-ACCEPTANCE: access-levels
816-
- TESTS: acceptance
817-
TESTS-ACCEPTANCE: app-files
818-
- TESTS: acceptance
819-
TESTS-ACCEPTANCE: app-theming
820-
- TESTS: acceptance
821-
TESTS-ACCEPTANCE: login
822-
- TESTS: jsunit
823-
- TESTS: syntax-php5.6
824-
- TESTS: syntax-php7.0
825-
- TESTS: syntax-php7.1
826-
- TESTS: phan
827-
- TESTS: litmus-v1
828-
- TESTS: litmus-v2
829-
- TESTS: caldavtester-old-endpoint
830-
- TESTS: caldavtester-new-endpoint
831-
- TESTS: carddavtester-new-endpoint
832-
- TESTS: carddavtester-old-endpoint
833-
- TESTS: object-store
834-
OBJECT_STORE: s3
835-
- TESTS: sqlite-php7.0-samba-native
836-
- TESTS: sqlite-php7.0-samba-non-native
837-
- TEST: memcache-memcached
838-
- TEST: memcache-redis-cluster
839-
ENABLE_REDIS_CLUSTER: true
840-
- TESTS: sqlite-php7.0-webdav-apache
841700
ENABLE_REDIS: true
842701

843702
services:

lib/private/Template/SCSSCacher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ private function prependBaseurlPrefix($cssFile) {
320320
*/
321321
private function getWebDir($path, $appName, $serverRoot, $webRoot) {
322322
// Detect if path is within server root AND if path is within an app path
323-
if ( !strpos($path, $serverRoot) && $appWebPath = \OC_App::getAppWebPath($appName) ) {
323+
if ( strpos($path, $serverRoot) === false && $appWebPath = \OC_App::getAppWebPath($appName)) {
324324
// Get the file path within the app directory
325325
$appDirectoryPath = explode($appName, $path)[1];
326326
// Remove the webroot

tests/lib/LegacyHelperTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
use OC_Helper;
1313

1414
class LegacyHelperTest extends \Test\TestCase {
15+
/** @var string */
16+
private $originalWebRoot;
17+
18+
public function setUp() {
19+
$this->originalWebRoot = \OC::$WEBROOT;
20+
}
21+
22+
public function tearDown() {
23+
// Reset webRoot
24+
\OC::$WEBROOT = $this->originalWebRoot;
25+
}
1526

1627
/**
1728
* @dataProvider humanFileSizeProvider

tests/lib/Template/SCSSCacherTest.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -384,17 +384,6 @@ public function testGetCachedSCSS($appName, $fileName, $result) {
384384
$this->assertEquals(substr($result, 1), $actual);
385385
}
386386

387-
public function dataGetWebDir() {
388-
return [
389-
['/http/core/css', 'core', '', '/http', '/core/css'],
390-
['/http/apps/test/css', 'test', '', '/http', '/apps/test/css'],
391-
['/http/nextcloud/core/css', 'core', '/nextcloud', '/http/nextcloud', '/nextcloud/core/css'],
392-
['/http/nextcloud/apps/test/css', 'test', '/nextcloud', '/http/nextcloud', '/nextcloud/apps/test/css'],
393-
['/srv/apps2/test/css', 'test', '', '/http', '/apps2/test/css'],
394-
['/srv/apps2/test/css', 'test', '/nextcloud', '/http/nextcloud', '/apps2/test/css']
395-
];
396-
}
397-
398387
private function randomString() {
399388
return sha1(uniqid(mt_rand(), true));
400389
}
@@ -411,6 +400,19 @@ private function rrmdir($directory) {
411400
return rmdir($directory);
412401
}
413402

403+
public function dataGetWebDir() {
404+
return [
405+
// Root installation
406+
['/http/core/css', 'core', '', '/http', '/core/css'],
407+
['/http/apps/scss/css', 'scss', '', '/http', '/apps/scss/css'],
408+
['/srv/apps2/scss/css', 'scss', '', '/http', '/apps2/scss/css'],
409+
// Sub directory install
410+
['/http/nextcloud/core/css', 'core', '/nextcloud', '/http/nextcloud', '/nextcloud/core/css'],
411+
['/http/nextcloud/apps/scss/css', 'scss', '/nextcloud', '/http/nextcloud', '/nextcloud/apps/scss/css'],
412+
['/srv/apps2/scss/css', 'scss', '/nextcloud', '/http/nextcloud', '/apps2/scss/css']
413+
];
414+
}
415+
414416
/**
415417
* @param $path
416418
* @param $appName

tests/lib/UrlGeneratorTest.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ class UrlGeneratorTest extends \Test\TestCase {
2727
private $request;
2828
/** @var IURLGenerator */
2929
private $urlGenerator;
30+
/** @var string */
31+
private $originalWebRoot;
3032

3133
public function setUp() {
3234
parent::setUp();
@@ -38,6 +40,12 @@ public function setUp() {
3840
$this->cacheFactory,
3941
$this->request
4042
);
43+
$this->originalWebRoot = \OC::$WEBROOT;
44+
}
45+
46+
public function tearDown() {
47+
// Reset webRoot
48+
\OC::$WEBROOT = $this->originalWebRoot;
4149
}
4250

4351
private function mockBaseUrl() {
@@ -47,7 +55,6 @@ private function mockBaseUrl() {
4755
$this->request->expects($this->once())
4856
->method('getServerHost')
4957
->willReturn('localhost');
50-
5158
}
5259

5360
/**
@@ -156,4 +163,3 @@ public function testGetBaseUrl() {
156163
}
157164

158165
}
159-

0 commit comments

Comments
 (0)