cache/integration-tests

Integration tests for PSR-6 and PSR-16 cache implementations

Package info

github.com/php-cache/integration-tests

pkg:composer/cache/integration-tests

Statistics

Installs: 3 541 546

Dependents: 100

Suggesters: 0

Stars: 40

Open Issues: 3

0.17.0 2020-11-03 12:52 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

Replaces

None

MIT eda2e6b8bc5abcd623c8047e2345cda38dd6479e

cachetestpsr6psr16


README

👁 Gitter
👁 Latest Stable Version
👁 Total Downloads
👁 Monthly Downloads
👁 Software License

This repository contains integration tests to make sure your implementation of a PSR-6 and/or PSR-16 cache follows the rules by PHP-FIG. It is a part of the PHP Cache organisation. To read about us please read the shared documentation at www.php-cache.com.

Install

composer require --dev cache/integration-tests:dev-master

Use

Create a test that looks like this:

class PoolIntegrationTest extends CachePoolTest
{
 public function createCachePool()
 {
 return new CachePool();
 }
}

You could also test your tag implementation:

class TagIntegrationTest extends TaggableCachePoolTest
{
 public function createCachePool()
 {
 return new CachePool();
 }
}

You can also test a PSR-16 implementation:

class CacheIntegrationTest extends SimpleCacheTest
{
 public function createSimpleCache()
 {
 return new SimpleCache();
 }
}

Contribute

Contributions are very welcome! Send a pull request or report any issues you find on the issue tracker.