Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
External Permalinks Redux
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WP Plugins
External Permalinks Redux
Commits
11b10e1c
Commit
11b10e1c
authored
2 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Test coverage
parent
e8df00ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!14
Add native block-editor support
Pipeline
#4811
failed with stages
in 2 minutes and 12 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test-class-external-permalinks-redux-block-editor.php
+91
-3
91 additions, 3 deletions
tests/test-class-external-permalinks-redux-block-editor.php
with
91 additions
and
3 deletions
tests/test-class-external-permalinks-redux-block-editor.php
+
91
−
3
View file @
11b10e1c
...
@@ -17,7 +17,43 @@ class TestClassExternalPermalinksReduxBlockEditor extends WP_UnitTestCase {
...
@@ -17,7 +17,43 @@ class TestClassExternalPermalinksReduxBlockEditor extends WP_UnitTestCase {
* @covers ::register_meta()
* @covers ::register_meta()
*/
*/
public
function
test_register_meta
()
{
public
function
test_register_meta
()
{
$this
->
markTestIncomplete
(
'This test has not been implemented.'
);
global
$wp_meta_keys
;
$wp_meta_keys
=
null
;
$this
->
assertFalse
(
registered_meta_key_exists
(
'post'
,
external_permalinks_redux
::
get_instance
()
->
meta_key_target
),
'Failed to assert that "target" meta key is not registered.'
);
$this
->
assertFalse
(
registered_meta_key_exists
(
'post'
,
external_permalinks_redux
::
get_instance
()
->
meta_key_type
),
'Failed to assert that "type" meta key is not registered.'
);
External_Permalinks_Redux_Block_Editor
::
get_instance
()
->
register_meta
();
$this
->
assertTrue
(
registered_meta_key_exists
(
'post'
,
external_permalinks_redux
::
get_instance
()
->
meta_key_target
),
'Failed to assert that "target" meta key is registered.'
);
$this
->
assertTrue
(
registered_meta_key_exists
(
'post'
,
external_permalinks_redux
::
get_instance
()
->
meta_key_type
),
'Failed to assert that "type" meta key is registered.'
);
}
}
/**
/**
...
@@ -26,7 +62,41 @@ class TestClassExternalPermalinksReduxBlockEditor extends WP_UnitTestCase {
...
@@ -26,7 +62,41 @@ class TestClassExternalPermalinksReduxBlockEditor extends WP_UnitTestCase {
* @covers ::allow_meta_updates()
* @covers ::allow_meta_updates()
*/
*/
public
function
test_allow_meta_updates
()
{
public
function
test_allow_meta_updates
()
{
$this
->
markTestIncomplete
(
'This test has not been implemented.'
);
$this
->
assertTrue
(
External_Permalinks_Redux_Block_Editor
::
get_instance
()
->
allow_meta_updates
(
true
,
'_a_random_key'
,
'term'
),
'Failed to assert that a term\'s key is not modified..'
);
$this
->
assertTrue
(
External_Permalinks_Redux_Block_Editor
::
get_instance
()
->
allow_meta_updates
(
true
,
'_a_random_key'
,
'post'
),
'Failed to assert that unrelated key\'s protection is not modified.'
);
$this
->
assertFalse
(
External_Permalinks_Redux_Block_Editor
::
get_instance
()
->
allow_meta_updates
(
true
,
external_permalinks_redux
::
get_instance
()
->
meta_key_target
,
'post'
),
'Failed to assert that "target" key is not protected.'
);
$this
->
assertFalse
(
External_Permalinks_Redux_Block_Editor
::
get_instance
()
->
allow_meta_updates
(
true
,
external_permalinks_redux
::
get_instance
()
->
meta_key_type
,
'post'
),
'Failed to assert that "type" key is not protected.'
);
}
}
/**
/**
...
@@ -35,6 +105,24 @@ class TestClassExternalPermalinksReduxBlockEditor extends WP_UnitTestCase {
...
@@ -35,6 +105,24 @@ class TestClassExternalPermalinksReduxBlockEditor extends WP_UnitTestCase {
* @covers ::enqueue()
* @covers ::enqueue()
*/
*/
public
function
test_enqueue
()
{
public
function
test_enqueue
()
{
$this
->
markTestIncomplete
(
'This test has not been implemented.'
);
$asset_handle
=
$asset_handle
=
'external-permalinks-redux'
;
$this
->
assertFalse
(
wp_script_is
(
$asset_handle
,
'enqueued'
),
'Failed to assert that script is not enqueued.'
);
External_Permalinks_Redux_Block_Editor
::
get_instance
()
->
enqueue
();
$this
->
assertTrue
(
wp_script_is
(
$asset_handle
,
'enqueued'
),
'Failed to assert that script is enqueued.'
);
$this
->
assertStringContainsString
(
'externalPermalinksReduxConfig'
,
wp_scripts
()
->
get_data
(
$asset_handle
,
'data'
),
'Failed to assert that configuration data is added.'
);
}
}
}
}
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