Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flysystem
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
flysystem
Commits
bd976f56
Commit
bd976f56
authored
1 year ago
by
Lisa Harrison
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3362008
: Update failing unit tests for Drupal 10 compatibility
parent
1251b9c2
No related branches found
No related tags found
4 merge requests
!43
Issue #3292158 by bbombachini, DieterHolvoet, hkirsman, Amanda95, alcalvo,...
,
!38
Issue #3292158 by bbombachini, DieterHolvoet, hkirsman, Amanda95, alcalvo,...
,
!37
Issue #3292158 by bbombachini, DieterHolvoet, hkirsman, Amanda95, alcalvo,...
,
!23
Issue #3362008: Update failing unit tests for Drupal 10 compatibility
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
flysystem.module
+1
-1
1 addition, 1 deletion
flysystem.module
tests/src/Unit/ModuleFunctionsTest.php
+7
-7
7 additions, 7 deletions
tests/src/Unit/ModuleFunctionsTest.php
with
8 additions
and
8 deletions
flysystem.module
+
1
−
1
View file @
bd976f56
...
...
@@ -33,7 +33,7 @@ function flysystem_file_download($uri) {
}
return
[
'Content-Type'
=>
Drupal
::
service
(
'file.mime_type.guesser.extension'
)
->
guess
(
$uri
),
'Content-Type'
=>
Drupal
::
service
(
'file.mime_type.guesser.extension'
)
->
guess
MimeType
(
$uri
),
'Content-Length'
=>
filesize
(
$uri
),
];
}
This diff is collapsed.
Click to expand it.
tests/src/Unit/ModuleFunctionsTest.php
+
7
−
7
View file @
bd976f56
...
...
@@ -7,7 +7,7 @@ use Drupal\Tests\UnitTestCase;
use
Drupal\flysystem\FlysystemFactory
;
use
Prophecy\Argument
;
use
Symfony\Component\DependencyInjection\ContainerBuilder
;
use
Symfony\Component\HttpFoundation
\File\MimeType\MimeTypeGuesser
Interface
;
use
Drupal\Core
\File\MimeType\
Extension
MimeTypeGuesser
;
use
org\bovigo\vfs\vfsStream
;
/**
...
...
@@ -42,8 +42,8 @@ class ModuleFunctionsTest extends UnitTestCase {
return
$scheme
;
});
$guesser
=
$this
->
prophesize
(
MimeTypeGuesser
Interface
::
class
);
$guesser
->
guess
(
Argument
::
type
(
'string'
))
->
willReturn
(
'txt/flysystem'
);
$guesser
=
$this
->
prophesize
(
Extension
MimeTypeGuesser
::
class
);
$guesser
->
guess
MimeType
(
Argument
::
type
(
'string'
))
->
willReturn
(
'txt/flysystem'
);
$container
=
new
ContainerBuilder
();
$container
->
set
(
'file_system'
,
$file_system_helper
->
reveal
());
...
...
@@ -73,13 +73,13 @@ class ModuleFunctionsTest extends UnitTestCase {
* Tests flysystem_file_download() handles valid schemes.
*/
public
function
testFlysystemFileDownloadFindsValidScheme
()
{
file_put_contents
(
'vfs://module_file/file.txt'
,
'1234'
);
$success
=
file_put_contents
(
'vfs://module_file/file.txt'
,
'1234'
);
$this
->
assertEquals
(
$success
,
4
);
$return
=
flysystem_file_download
(
'vfs://module_file/file.txt'
);
$this
->
assert
Same
(
2
,
count
(
$return
));
$this
->
assert
Equals
(
2
,
count
(
$return
));
$this
->
assertSame
(
'txt/flysystem'
,
$return
[
'Content-Type'
]);
$this
->
assert
Same
(
4
,
$return
[
'Content-Length'
]);
$this
->
assert
Equals
(
4
,
$return
[
'Content-Length'
]);
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment