Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Redis User Session Storage
Manage
Activity
Members
Labels
Plan
Issues
1
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
Redis User Session Storage
Commits
8655d248
Commit
8655d248
authored
2 years ago
by
Erick Hitter
Browse files
Options
Downloads
Patches
Plain Diff
Prepare for tests
parent
5164708a
No related branches found
No related tags found
1 merge request
!6
Add tests
Pipeline
#5040
failed with stages
in 2 minutes and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/inc/class-test-plugin.php
+12
-8
12 additions, 8 deletions
tests/inc/class-test-plugin.php
with
12 additions
and
8 deletions
tests/inc/test-plugin.php
→
tests/inc/
class-
test-plugin.php
+
12
−
8
View file @
8655d248
...
...
@@ -13,17 +13,21 @@ use WP_Session_Tokens;
use
WP_UnitTestCase
;
/**
* Tests for main plugin class.
*
* @coversDefaultClass \Redis_User_Session_Storage\Plugin
*/
class
TestPlugin
extends
WP_UnitTestCase
{
protected
$plugin
;
public
function
set_up
()
{
// TODO: use reflection to make this more useful. Create a helper, stop initializing here.
$this
->
plugin
=
new
Plugin
(
0
);
}
class
Test_Plugin
extends
WP_UnitTestCase
{
/**
* Test construction.
*
* @covers ::__construct()
* @return void
*/
public
function
test__construct
()
{
$user_id
=
$this
->
factory
->
user
->
create
();
$this
->
plugin
=
new
Plugin
(
$user_id
);
$this
->
assertTrue
(
class_exists
(
Redis
::
class
,
false
)
);
$this
->
assertInstanceOf
(
Plugin
::
class
,
$this
->
plugin
);
...
...
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