Commit e8c6e567 authored by Erick Hitter's avatar Erick Hitter

Begin tests

parent 8c55298d
Pipeline #1165 failed with stage
in 2 minutes and 49 seconds
......@@ -28,6 +28,7 @@ PHPunit:PHP5.3:MySQL:
image: containers.ethitter.com:443/docker/images/php:5.3
services:
- mysql:5.6
- redis:latest
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
......@@ -37,6 +38,7 @@ PHPunit:PHP5.6:MySQL:
image: containers.ethitter.com:443/docker/images/php:5.6
services:
- mysql:5.6
- redis:latest
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
......@@ -46,6 +48,7 @@ PHPunit:PHP7.0:MySQL:
image: containers.ethitter.com:443/docker/images/php:7.0
services:
- mysql:5.6
- redis:latest
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
......@@ -55,6 +58,7 @@ PHPunit:PHP7.1:MySQL:
image: containers.ethitter.com:443/docker/images/php:7.1
services:
- mysql:5.6
- redis:latest
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
......@@ -64,6 +68,7 @@ PHPunit:PHP7.2:MySQL:
image: containers.ethitter.com:443/docker/images/php:7.2
services:
- mysql:5.6
- redis:latest
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
......@@ -73,6 +78,7 @@ PHPunit:PHP7.3:MySQL:
image: containers.ethitter.com:443/docker/images/php:7.3
services:
- mysql:5.6
- redis:latest
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- phpunit
......
......@@ -269,6 +269,15 @@ class WP_Redis_User_Session_Storage extends WP_Session_Tokens {
protected function get_key() {
return $this->prefix . ':' . $this->user_id;
}
/**
* Is Redis connected?
*
* @return bool
*/
public function redis_connected() {
return $this->redis_connected;
}
}
/**
......
<?php
/**
* Plugin tests
*
* @package WP_Redis_User_Session_Storage
*/
/**
* Class Test_Plugin.
*/
class Test_Plugin extends WP_UnitTestCase {
/**
* Check that Redis backend is available.
*/
public function test_connection() {
$this->assertTrue(
WP_Session_Tokens::get_instance( 0 )->redis_connected(),
'Failed to assert that Redis is available.'
);
}
}
<?php
/**
* Class SampleTest
*
* @package WP_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 );
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment