diff --git a/tests/inc/test-plugin.php b/tests/inc/class-test-plugin.php similarity index 69% rename from tests/inc/test-plugin.php rename to tests/inc/class-test-plugin.php index 21e4abb45c6bcd446b322a8eaee25d8f85dca837..fb3de76deff84469196b6e94a307a787c34d7d7b 100755 --- a/tests/inc/test-plugin.php +++ b/tests/inc/class-test-plugin.php @@ -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 );