Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Automatically Paginate Posts
Manage
Activity
Members
Labels
Plan
Issues
11
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
Automatically Paginate Posts
Commits
fbc7d258
Commit
fbc7d258
authored
2 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Test coverage
parent
3e5084a4
Loading
Loading
1 merge request
!5
Add block-editor support
Pipeline
#4959
failed with stages
in 2 minutes and 7 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
phpunit.xml
+1
-2
1 addition, 2 deletions
phpunit.xml
tests/bootstrap.php
+1
-1
1 addition, 1 deletion
tests/bootstrap.php
tests/test-automatically-paginate-posts.php
+59
-0
59 additions, 0 deletions
tests/test-automatically-paginate-posts.php
tests/test-sample.php
+0
-20
0 additions, 20 deletions
tests/test-sample.php
with
61 additions
and
23 deletions
phpunit.xml
+
1
−
2
View file @
fbc7d258
...
@@ -8,9 +8,8 @@
...
@@ -8,9 +8,8 @@
convertWarningsToExceptions=
"true"
convertWarningsToExceptions=
"true"
>
>
<testsuites>
<testsuites>
<testsuite>
<testsuite
name=
"Autopaging"
>
<directory
prefix=
"test-"
suffix=
".php"
>
./tests/
</directory>
<directory
prefix=
"test-"
suffix=
".php"
>
./tests/
</directory>
<exclude>
./tests/test-sample.php
</exclude>
</testsuite>
</testsuite>
</testsuites>
</testsuites>
</phpunit>
</phpunit>
This diff is collapsed.
Click to expand it.
tests/bootstrap.php
+
1
−
1
View file @
fbc7d258
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* @package Automatically_Paginate_Posts
* @package Automatically_Paginate_Posts
*/
*/
$autopaging_tests_dir
=
getenv
(
'WP
autopaging_tests_dir
'
);
$autopaging_tests_dir
=
getenv
(
'WP
_TESTS_DIR
'
);
if
(
!
$autopaging_tests_dir
)
{
if
(
!
$autopaging_tests_dir
)
{
$autopaging_tests_dir
=
rtrim
(
sys_get_temp_dir
(),
'/\\'
)
.
'/wordpress-tests-lib'
;
$autopaging_tests_dir
=
rtrim
(
sys_get_temp_dir
(),
'/\\'
)
.
'/wordpress-tests-lib'
;
...
...
This diff is collapsed.
Click to expand it.
tests/test-automatically-paginate-posts.php
0 → 100755
+
59
−
0
View file @
fbc7d258
<?php
/**
* Test main plugin class.
*
* @package Automatically_Paginate_Posts
*/
/**
* @coversDefaultClass Automatically_Paginate_Posts
*/
class
SampleTest
extends
WP_UnitTestCase
{
protected
$_instance
;
public
function
set_up
()
{
parent
::
set_up
();
$this
->
_instance
=
new
Automatically_Paginate_Posts
();
}
/**
* @covers ::__get()
*/
public
function
test___get
()
{
$this
->
assertEquals
(
'_disable_autopaging'
,
$this
->
_instance
->
meta_key
,
'Failed to assert meta key matched expected value.'
);
// TODO: consider testing `post_types` along with a filter.
$this
->
assertNull
(
$this
->
_instance
->
unit_test
,
'Failed to assert that unsupported key returns null.'
);
}
/**
* @covers ::filter_plugin_action_links()
*/
public
function
test_filter_plugin_action_links
()
{
$this
->
assertEmpty
(
$this
->
_instance
->
filter_plugin_action_links
(
array
(),
'unit-test.php'
),
'Failed to assert that no change is made for other plugins..'
);
$this
->
assertArrayHasKey
(
'settings'
,
$this
->
_instance
->
filter_plugin_action_links
(
array
(),
'automatically-paginate-posts/automatically-paginate-posts.php'
),
'Failed to assert that settings link is added for this plugin.'
);
}
}
This diff is collapsed.
Click to expand it.
tests/test-sample.php
deleted
100755 → 0
+
0
−
20
View file @
3e5084a4
<?php
/**
* Class SampleTest
*
* @package Automatically_Paginate_Posts
*/
/**
* 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