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
de2b2f76
Commit
de2b2f76
authored
5 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Add tests for permalink filters
parent
920a3ca6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/test-permalink-filters.php
+69
-0
69 additions, 0 deletions
tests/test-permalink-filters.php
tests/test-sample.php
+0
-20
0 additions, 20 deletions
tests/test-sample.php
with
69 additions
and
20 deletions
tests/test-permalink-filters.php
0 → 100755
+
69
−
0
View file @
de2b2f76
<?php
/**
* Class PermalinkFilters
*
* @package External_Permalinks_Redux
*/
/**
* Test permalink filters
*/
class
PermalinkFilters
extends
WP_UnitTestCase
{
/**
* Redirect destination.
*/
const
DESTINATION
=
'https://w.org/'
;
/**
* Test post ID.
*
* @var int
*/
protected
$post_id
;
/**
* Test page ID.
*
* @var int
*/
protected
$page_id
;
/**
* Create some objects with redirects.
*/
public
function
setUp
()
{
parent
::
setUp
();
$plugin
=
external_permalinks_redux
::
get_instance
();
$this
->
post_id
=
$this
->
factory
->
post
->
create
(
[
'post_type'
=>
'post'
,
]
);
update_post_meta
(
$this
->
post_id
,
$plugin
->
meta_key_target
,
static
::
DESTINATION
);
$this
->
page_id
=
$this
->
factory
->
post
->
create
(
[
'post_type'
=>
'page'
,
]
);
update_post_meta
(
$this
->
page_id
,
$plugin
->
meta_key_target
,
static
::
DESTINATION
);
}
/**
* Test post permalink filter.
*/
public
function
test_post
()
{
$this
->
assertEquals
(
static
::
DESTINATION
,
get_permalink
(
$this
->
post_id
)
);
}
/**
* Test page link filter.
*/
public
function
test_page
()
{
$this
->
assertEquals
(
static
::
DESTINATION
,
get_page_link
(
$this
->
page_id
)
);
}
}
This diff is collapsed.
Click to expand it.
tests/test-sample.php
deleted
100755 → 0
+
0
−
20
View file @
920a3ca6
<?php
/**
* Class SampleTest
*
* @package External_Permalinks_Redux
*/
/**
* Sample test case.
*/
class
SampleTest
extends
WP_UnitTestCase
{
/**
* A single example test.
*/
public
function
test_sample
()
{
// Replace this with some actual testing code.
$this
->
assertTrue
(
true
);
}
}
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