Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
wp-cli-cron-control-offload
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
WP Plugins
wp-cli-cron-control-offload
Commits
3338de9b
Commit
3338de9b
authored
7 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Introduce first tests, and fix test structure to appease PHPCS
parent
f3511ee9
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
phpunit.xml.dist
+1
-1
1 addition, 1 deletion
phpunit.xml.dist
tests/test-sample.php
+0
-20
0 additions, 20 deletions
tests/test-sample.php
tests/tests/class-plugin-functions.php
+31
-0
31 additions, 0 deletions
tests/tests/class-plugin-functions.php
with
32 additions
and
21 deletions
phpunit.xml.dist
+
1
−
1
View file @
3338de9b
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
>
>
<testsuites>
<testsuites>
<testsuite>
<testsuite>
<directory
prefix="test-"
suffix=".php">./tests/</directory>
<directory suffix=".php">./tests/
tests/
</directory>
</testsuite>
</testsuite>
</testsuites>
</testsuites>
</phpunit>
</phpunit>
This diff is collapsed.
Click to expand it.
tests/test-sample.php
deleted
100644 → 0
+
0
−
20
View file @
f3511ee9
<?php
/**
* Class SampleTest
*
* @package WP_CLI_Cron_Control_Offload
*/
/**
* Sample test case.
*/
class
SampleTest
extends
WP_UnitTestCase
{
/**
* A single example test.
*/
function
test_sample
()
{
// Replace this with some actual testing code.
$this
->
assertTrue
(
true
);
}
}
This diff is collapsed.
Click to expand it.
tests/tests/class-plugin-functions.php
0 → 100644
+
31
−
0
View file @
3338de9b
<?php
/**
* Test plugin's common functions
*
* @package WP_CLI_Cron_Control_Offload
*/
namespace
Automattic\WP\WP_CLI_Cron_Control_Offload\Tests
;
use
Automattic\WP\WP_CLI_Cron_Control_Offload
;
use
WP_UnitTestCase
;
/**
* Sample test case.
*/
class
SampleTest
extends
WP_UnitTestCase
{
/**
* Test whitelisted commands
*/
function
test_whitelist
()
{
$this
->
assertTrue
(
WP_CLI_Cron_Control_Offload\is_command_allowed
(
'wp post list'
)
);
$this
->
assertTrue
(
WP_CLI_Cron_Control_Offload\is_command_allowed
(
'post list'
)
);
}
/**
* Test blacklisted commands
*/
function
test_blacklist
()
{
$this
->
assertFalse
(
WP_CLI_Cron_Control_Offload\is_command_allowed
(
'wp cli info'
)
);
$this
->
assertFalse
(
WP_CLI_Cron_Control_Offload\is_command_allowed
(
'cli info'
)
);
}
}
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