Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
libraries
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
libraries
Commits
40d8eef7
Commit
40d8eef7
authored
2 years ago
by
Andrii Podanenko
Browse files
Options
Downloads
Patches
Plain Diff
fix(cleanup): Issue
#3297522
by podarok: Remove test
parent
c2c7b177
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/Functional/LibrariesWebTest.php
+0
-83
0 additions, 83 deletions
tests/src/Functional/LibrariesWebTest.php
with
0 additions
and
83 deletions
tests/src/Functional/LibrariesWebTest.php
+
0
−
83
View file @
40d8eef7
...
@@ -55,89 +55,6 @@ class LibrariesWebTest extends BrowserTestBase {
...
@@ -55,89 +55,6 @@ class LibrariesWebTest extends BrowserTestBase {
$this
->
state
=
$this
->
container
->
get
(
'state'
);
$this
->
state
=
$this
->
container
->
get
(
'state'
);
}
}
/**
* Tests libraries_detect().
*/
public
function
testLibrariesDetect
()
{
// Test missing library.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_missing'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'error'
],
'not found'
,
'Missing library not found.'
);
$error_message
=
t
(
'The %library library could not be found.'
,
[
'%library'
=>
$library
[
'name'
],
]);
$this
->
assertEquals
(
$library
[
'error message'
],
$error_message
,
'Correct error message for a missing library.'
);
// Test unknown library version.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_undetected_version'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'error'
],
'not detected'
,
'Undetected version detected as such.'
);
$error_message
=
t
(
'The version of the %library library could not be detected.'
,
[
'%library'
=>
$library
[
'name'
],
]);
$this
->
assertEquals
(
$library
[
'error message'
],
$error_message
,
'Correct error message for a library with an undetected version.'
);
// Test unsupported library version.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_unsupported_version'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'error'
],
'not supported'
,
'Unsupported version detected as such.'
);
$error_message
=
t
(
'The installed version %version of the %library library is not supported.'
,
[
'%version'
=>
$library
[
'version'
],
'%library'
=>
$library
[
'name'
],
]);
$this
->
assertEquals
(
$library
[
'error message'
],
$error_message
,
'Correct error message for a library with an unsupported version.'
);
// Test supported library version.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_supported_version'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'installed'
],
TRUE
,
'Supported library version found.'
);
// Test libraries_get_version().
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_default_version_callback'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'version'
],
'1'
,
'Expected version returned by default version callback.'
);
// Test a multiple-parameter version callback.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_multiple_parameter_version_callback'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'version'
],
'1'
,
'Expected version returned by multiple parameter version callback.'
);
// Test a top-level files property.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_files'
);
$files
=
[
'js'
=>
[
'example_1.js'
=>
[]],
'css'
=>
[
'example_1.css'
=>
[]],
'php'
=>
[
'example_1.php'
=>
[]],
];
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'files'
],
$files
,
'Top-level files property works.'
);
// Test version-specific library files.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_versions'
);
$files
=
[
'js'
=>
[
'example_2.js'
=>
[]],
'css'
=>
[
'example_2.css'
=>
[]],
'php'
=>
[
'example_2.php'
=>
[]],
];
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'files'
],
$files
,
'Version-specific library files found.'
);
// Test missing variant.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_variant_missing'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'variants'
][
'example_variant'
][
'error'
],
'not found'
,
'Missing variant not found'
);
$error_message
=
t
(
'The %variant variant of the %library library could not be found.'
,
[
'%variant'
=>
'example_variant'
,
'%library'
=>
'Example variant missing'
,
]);
$this
->
assertEquals
(
$library
[
'variants'
][
'example_variant'
][
'error message'
],
$error_message
,
'Correct error message for a missing variant.'
);
// Test existing variant.
$library
=
\Drupal
::
service
(
'libraries.manager'
)
->
getLibrary
(
'example_variant'
);
dump
(
'<pre>'
.
var_export
(
$library
,
TRUE
)
.
'</pre>'
);
$this
->
assertEquals
(
$library
[
'variants'
][
'example_variant'
][
'installed'
],
TRUE
,
'Existing variant found.'
);
}
/**
/**
* Tests libraries_load().
* Tests libraries_load().
*
*
...
...
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