diff --git a/.drone.yml b/.drone.yml index 3507d306c10d9..470c8f8809038 100644 --- a/.drone.yml +++ b/.drone.yml @@ -228,6 +228,7 @@ steps: image: ghcr.io/nextcloud/continuous-integration-php8.0:latest commands: - bash tests/drone-run-php-tests.sh || exit 0 + - composer install --working-dir=build/integration - NOCOVERAGE=true TEST_SELECTION=NODB ./autotest.sh sqlite services: diff --git a/build/integration/composer.json b/build/integration/composer.json index 0ce3d9e2d15cc..4a5623a18656d 100644 --- a/build/integration/composer.json +++ b/build/integration/composer.json @@ -6,6 +6,7 @@ "guzzlehttp/guzzle": "7.6.1", "jarnaiz/behat-junit-formatter": "^1.3", "sabre/dav": "4.4.0", - "symfony/event-dispatcher": "~5.3" + "symfony/event-dispatcher": "~5.3", + "mikey179/vfsstream": "^1.6" } } diff --git a/build/integration/composer.lock b/build/integration/composer.lock index cbae42b4aa8b7..50099c44e0a79 100644 --- a/build/integration/composer.lock +++ b/build/integration/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "3f70730fd3a96421a6eb98ceded7ce71", + "content-hash": "fc14ec29883127d72d5151bb492db619", "packages": [], "packages-dev": [ { @@ -689,6 +689,57 @@ }, "time": "2016-01-26T17:05:07+00:00" }, + { + "name": "mikey179/vfsstream", + "version": "v1.6.11", + "source": { + "type": "git", + "url": "https://github.com/bovigo/vfsStream.git", + "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bovigo/vfsStream/zipball/17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", + "reference": "17d16a85e6c26ce1f3e2fa9ceeacdc2855db1e9f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.5|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "org\\bovigo\\vfs\\": "src/main/php" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Frank Kleine", + "homepage": "http://frankkleine.de/", + "role": "Developer" + } + ], + "description": "Virtual file system to mock the real file system in unit tests.", + "homepage": "http://vfs.bovigo.org/", + "support": { + "issues": "https://github.com/bovigo/vfsStream/issues", + "source": "https://github.com/bovigo/vfsStream/tree/master", + "wiki": "https://github.com/bovigo/vfsStream/wiki" + }, + "time": "2022-02-23T02:02:42+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.11.1", diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php index 079117f562257..b843d830de897 100644 --- a/tests/lib/Files/Type/DetectionTest.php +++ b/tests/lib/Files/Type/DetectionTest.php @@ -135,6 +135,7 @@ public function testMimeTypeIcon() { if (!class_exists('org\\bovigo\\vfs\\vfsStream')) { $this->markTestSkipped('Package vfsStream not installed'); } + $confDir = \org\bovigo\vfs\vfsStream::setup(); $mimetypealiases_dist = \org\bovigo\vfs\vfsStream::newFile('mimetypealiases.dist.json')->at($confDir); @@ -157,7 +158,7 @@ public function testMimeTypeIcon() { //Only call the url generator once $urlGenerator->expects($this->once()) ->method('imagePath') - ->with($this->equalTo('core'), $this->equalTo('filetypes/folder.png')) + ->with($this->equalTo('core'), $this->equalTo('filetypes/folder.svg')) ->willReturn('folder.svg'); $detection = new Detection($urlGenerator, $logger, $confDir->url(), $confDir->url()); @@ -176,7 +177,7 @@ public function testMimeTypeIcon() { //Only call the url generator once $urlGenerator->expects($this->once()) ->method('imagePath') - ->with($this->equalTo('core'), $this->equalTo('filetypes/folder-shared.png')) + ->with($this->equalTo('core'), $this->equalTo('filetypes/folder-shared.svg')) ->willReturn('folder-shared.svg'); $detection = new Detection($urlGenerator, $logger, $confDir->url(), $confDir->url()); @@ -196,7 +197,7 @@ public function testMimeTypeIcon() { //Only call the url generator once $urlGenerator->expects($this->once()) ->method('imagePath') - ->with($this->equalTo('core'), $this->equalTo('filetypes/folder-external.png')) + ->with($this->equalTo('core'), $this->equalTo('filetypes/folder-external.svg')) ->willReturn('folder-external.svg'); $detection = new Detection($urlGenerator, $logger, $confDir->url(), $confDir->url()); @@ -216,7 +217,7 @@ public function testMimeTypeIcon() { //Only call the url generator once $urlGenerator->expects($this->once()) ->method('imagePath') - ->with($this->equalTo('core'), $this->equalTo('filetypes/my-type.png')) + ->with($this->equalTo('core'), $this->equalTo('filetypes/my-type.svg')) ->willReturn('my-type.svg'); $detection = new Detection($urlGenerator, $logger, $confDir->url(), $confDir->url()); @@ -237,12 +238,12 @@ public function testMimeTypeIcon() { $urlGenerator->expects($this->exactly(2)) ->method('imagePath') ->withConsecutive( - [$this->equalTo('core'), $this->equalTo('filetypes/my-type.png')], - [$this->equalTo('core'), $this->equalTo('filetypes/my.png')] + [$this->equalTo('core'), $this->equalTo('filetypes/my-type.svg')], + [$this->equalTo('core'), $this->equalTo('filetypes/my.svg')] ) ->willReturnCallback( function ($appName, $file) { - if ($file === 'filetypes/my.png') { + if ($file === 'filetypes/my.svg') { return 'my.svg'; } throw new \RuntimeException(); @@ -267,13 +268,13 @@ function ($appName, $file) { $urlGenerator->expects($this->exactly(3)) ->method('imagePath') ->withConsecutive( - [$this->equalTo('core'), $this->equalTo('filetypes/foo-bar.png')], - [$this->equalTo('core'), $this->equalTo('filetypes/foo.png')], - [$this->equalTo('core'), $this->equalTo('filetypes/file.png')] + [$this->equalTo('core'), $this->equalTo('filetypes/foo-bar.svg')], + [$this->equalTo('core'), $this->equalTo('filetypes/foo.svg')], + [$this->equalTo('core'), $this->equalTo('filetypes/file.svg')] ) ->willReturnCallback( function ($appName, $file) { - if ($file === 'filetypes/file.png') { + if ($file === 'filetypes/file.svg') { return 'file.svg'; } throw new \RuntimeException(); @@ -296,7 +297,7 @@ function ($appName, $file) { //Only call the url generator once $urlGenerator->expects($this->once()) ->method('imagePath') - ->with($this->equalTo('core'), $this->equalTo('filetypes/foo-bar.png')) + ->with($this->equalTo('core'), $this->equalTo('filetypes/foo-bar.svg')) ->willReturn('foo-bar.svg'); $detection = new Detection($urlGenerator, $logger, $confDir->url(), $confDir->url()); @@ -322,7 +323,7 @@ function ($appName, $file) { //Only call the url generator once $urlGenerator->expects($this->once()) ->method('imagePath') - ->with($this->equalTo('core'), $this->equalTo('filetypes/foobar-baz.png')) + ->with($this->equalTo('core'), $this->equalTo('filetypes/foobar-baz.svg')) ->willReturn('foobar-baz.svg'); $detection = new Detection($urlGenerator, $logger, $confDir->url(), $confDir->url());