From 8655d248a46598636964c8aea1ecdc1ee29d545e Mon Sep 17 00:00:00 2001
From: Erick Hitter <git-contrib@ethitter.com>
Date: Sat, 9 Jul 2022 13:20:42 -0700
Subject: [PATCH] Prepare for tests

---
 ...{test-plugin.php => class-test-plugin.php} | 20 +++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
 rename tests/inc/{test-plugin.php => class-test-plugin.php} (69%)

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 21e4abb..fb3de76 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 );
-- 
GitLab