diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 73da1815ea08528e216196746a390d7132a9e129..24e3d30ea1ffb7f5da9975e44db44195bd66b8fb 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,2 +1,5 @@ include: - - remote: https://git-cdn.e15r.co/gitlab/ci/wordpress/-/raw/main/plugins/default.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/wordpress/-/raw/main/plugins/templates/variables.yml + - remote: https://git-cdn.e15r.co/gitlab/ci/wordpress/-/raw/main/plugins/templates/cache.yml + - remote: https://git.ethitter.com/gitlab/ci/wordpress/-/raw/add/redis/plugins/templates/before-script-redis.yml + - remote: https://git.ethitter.com/gitlab/ci/wordpress/-/raw/add/redis/plugins/templates/matrix-redis.yml diff --git a/tests/inc/test-plugin.php b/tests/inc/test-plugin.php new file mode 100755 index 0000000000000000000000000000000000000000..47cb5333f53f801b302d4807f1b21fb7a2d6f53c --- /dev/null +++ b/tests/inc/test-plugin.php @@ -0,0 +1,31 @@ +<?php +/** + * Test plugin features. + * + * @package Redis_User_Session_Storage + */ + +namespace Redis_User_Session_Storage\Tests\Inc; + +use Redis_User_Session_Storage\Plugin; +use WP_Session_Tokens; +use WP_UnitTestCase; + +/** + * @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 ); + } + + public function test__construct() { + $this->assertInstanceOf( Plugin::class, $this->plugin ); + $this->assertInstanceOf( WP_Session_Tokens::class, $this->plugin ); + + $this->assertEquals( 'wpruss', $this->plugin->prefix ); + } +} diff --git a/tests/test-sample.php b/tests/test-sample.php deleted file mode 100755 index c8f05ed5bd8bfe159a2d1b5efe3a96e2dbf30198..0000000000000000000000000000000000000000 --- a/tests/test-sample.php +++ /dev/null @@ -1,20 +0,0 @@ -<?php -/** - * Class SampleTest - * - * @package Redis_User_Session_Storage - */ - -/** - * Sample test case. - */ -class SampleTest extends WP_UnitTestCase { - - /** - * A single example test. - */ - public function test_sample() { - // Replace this with some actual testing code. - $this->assertTrue( true ); - } -}