Skip to content
Snippets Groups Projects

Add tests

Merged Erick Hitter requested to merge add/tests into master
1 file
+ 12
8
Compare changes
  • Side-by-side
  • Inline
@@ -13,17 +13,21 @@ use WP_Session_Tokens;
@@ -13,17 +13,21 @@ use WP_Session_Tokens;
use WP_UnitTestCase;
use WP_UnitTestCase;
/**
/**
 
* Tests for main plugin class.
 
*
* @coversDefaultClass \Redis_User_Session_Storage\Plugin
* @coversDefaultClass \Redis_User_Session_Storage\Plugin
*/
*/
class TestPlugin extends WP_UnitTestCase {
class Test_Plugin extends WP_UnitTestCase {
protected $plugin;
/**
* Test construction.
public function set_up() {
*
// TODO: use reflection to make this more useful. Create a helper, stop initializing here.
* @covers ::__construct()
$this->plugin = new Plugin( 0 );
* @return void
}
*/
public function test__construct() {
public function test__construct() {
 
$user_id = $this->factory->user->create();
 
$this->plugin = new Plugin( $user_id );
 
$this->assertTrue( class_exists( Redis::class, false ) );
$this->assertTrue( class_exists( Redis::class, false ) );
$this->assertInstanceOf( Plugin::class, $this->plugin );
$this->assertInstanceOf( Plugin::class, $this->plugin );
Loading