Skip to content

Commit

Permalink
dev/2.1.0 (#15)
Browse files Browse the repository at this point in the history
* Fixing the unit and integration tests (for phpunit 7+)
* PHP min. requirement is 7.2
* Removed "--ignore-platform-reqs" for composer
* Version bump
* Badge update
* Removed support for PHP 7.1
  • Loading branch information
kodeart authored Sep 9, 2019
1 parent 8d62ca7 commit b006d5c
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 63 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ cache:
- $HOME/.composer/cache

php:
- 7.1
- 7.2
- 7.3

Expand All @@ -31,7 +30,7 @@ before_script:
- pecl install msgpack

install:
- composer update -o --no-interaction --prefer-stable --ignore-platform-reqs
- composer update -o --no-interaction --prefer-stable

script:
- vendor/bin/phpunit --coverage-clover build/coverage/clover.xml
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Koded - Simple Caching Library
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/1b3bad367cc74a3fa98996c252cdfe6f)](https://www.codacy.com/app/kodeart/cache-simple)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1b3bad367cc74a3fa98996c252cdfe6f)](https://www.codacy.com/app/kodeart/cache-simple)
[![Packagist Downloads](https://img.shields.io/packagist/dt/koded/cache-simple.svg)](https://packagist.org/packages/koded/cache-simple)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.2-8892BF.svg)](https://php.net/)
[![Software license](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](LICENSE)

A [PSR-16][10] simple caching library for PHP 7 using several caching technologies.
Expand Down
2 changes: 1 addition & 1 deletion Tests/Client/FileClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function test_global_ttl()
$this->assertFalse($client->has('key'));
}

protected function setUp()
protected function setUp(): void
{
$this->dir = vfsStream::setup();
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/Client/MemoryClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function test_global_ttl_when_set()
'Global TTL is ignored if explicit is not NULL');
}

protected function setUp()
protected function setUp(): void
{
putenv('CACHE_CLIENT=memory');
$this->cache = (new CacheClientFactory(new ConfigFactory))->new();
Expand Down
2 changes: 1 addition & 1 deletion Tests/Configuration/MemcachedConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function test_should_build_default_arguments()
], $config->getOptions());
}

protected function tearDown()
protected function tearDown(): void
{
putenv('MEMCACHED_POOL=');
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/FileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function test_should_return_self()
$this->assertInstanceOf(FileClient::class, $this->cache->client());
}

protected function setUp()
protected function setUp(): void
{
$dir = vfsStream::setup();
$this->cache = new FileClient(new NullLogger, $dir->url());
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/FileClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function createSimpleCache()
return simple_cache_factory('file');
}

protected function setUp()
protected function setUp(): void
{
$this->skippedTests = [
'testSetMultipleInvalidKeys' => '',
Expand Down
35 changes: 1 addition & 34 deletions Tests/Integration/MemcachedClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function createSimpleCache()
return simple_cache_factory('memcached');
}

protected function setUp()
protected function setUp(): void
{
if (false === extension_loaded('memcached')) {
$this->markTestSkipped('Memcached extension is not loaded.');
Expand Down Expand Up @@ -50,39 +50,6 @@ protected function setUp()
'testSetMultipleWithGenerator' => '',
'testGetMultiple' => '',
'testSetMultipleInvalidKeys' => '',

// 'testGetMultipleWithGenerator' => '',
// 'testDeleteMultiple' => '',
// 'testGetMultipleWithGenerator' => '',
// 'testDeleteMultiple' => '',
// 'testDeleteMultipleGenerator' => '',
// 'testHas' => '',
// 'testGetInvalidKeys' => '',
// 'testGetMultipleInvalidKeys' => '',
// 'testGetMultipleNoIterable' => '',
// 'testSetInvalidKeys' => '',
// 'testSetMultipleInvalidKeys' => '',
// 'testSetMultipleNoIterable' => '',
// 'testHasInvalidKeys' => '',
// 'testDeleteInvalidKeys' => '',
// 'testDeleteMultipleInvalidKeys' => '',
// 'testDeleteMultipleNoIterable' => '',
// 'testSetInvalidTtl' => '',
// 'testSetMultipleInvalidTtl' => '',
// 'testNullOverwrite' => '',
// 'testDataTypeString' => '',
// 'testDataTypeInteger' => '',
// 'testDataTypeFloat' => '',
// 'testDataTypeBoolean' => '',
// 'testDataTypeArray' => '',
// 'testDataTypeObject' => '',
// 'testBinaryData' => '',
// 'testSetValidKeys' => '',
// 'testSetMultipleValidKeys' => '',
// 'testSetValidData' => '',
// 'testSetMultipleValidData' => '',
// 'testObjectAsDefaultValue' => '',
// 'testObjectDoesNotChangeInCache' => '',
];
}
}
2 changes: 1 addition & 1 deletion Tests/Integration/PredisClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function createSimpleCache()
]);
}

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->cache->clear();
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/PredisJsonClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function createSimpleCache()
]);
}

protected function setUp()
protected function setUp(): void
{
parent::setUp();
$this->cache->clear();
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/RedisClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function createSimpleCache()
]);
}

protected function setUp()
protected function setUp(): void
{
if (false === extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not loaded.');
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/RedisJsonClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function createSimpleCache()
]);
}

protected function setUp()
protected function setUp(): void
{
if (false === extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not loaded.');
Expand Down
2 changes: 1 addition & 1 deletion Tests/Integration/SimpleCacheIntegrationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static function invalidKeys()
return array_values($keys);
}

protected function tearDown()
protected function tearDown(): void
{
putenv('CACHE_CLIENT=');

Expand Down
2 changes: 1 addition & 1 deletion Tests/InvalidSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function test_should_fail_on_invalid_serializer_in_configuration()
])))->new();
}

protected function setUp()
protected function setUp(): void
{
if (false === extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not loaded.');
Expand Down
2 changes: 1 addition & 1 deletion Tests/MemcachedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function test_should_return_memcached_client()
$this->assertInstanceOf(\Memcached::class, $this->cache->client());
}

protected function setUp()
protected function setUp(): void
{
putenv('CACHE_CLIENT=memcached');

Expand Down
4 changes: 2 additions & 2 deletions Tests/PredisConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ public function test_predis_auth_exception()
])))->new();
}

protected function setUp()
protected function setUp(): void
{
putenv('CACHE_CLIENT=predis');
}

protected function tearDown()
protected function tearDown(): void
{
putenv('CACHE_CLIENT=');
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/PredisWithJsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function test_should_return_predis_client()
$this->assertInstanceOf(Client::class, $this->cache->client());
}

protected function setUp()
protected function setUp(): void
{
putenv('CACHE_CLIENT=predis');

Expand Down
4 changes: 2 additions & 2 deletions Tests/RedisConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function test_predis_auth_exception()
$this->assertTrue($redis->client()->isConnected(), 'The auth is ignored, even it is not set in Redis');
}

protected function setUp()
protected function setUp(): void
{
if (false === extension_loaded('redis')) {
$this->markTestSkipped('Redis extension is not loaded.');
Expand All @@ -65,7 +65,7 @@ protected function setUp()
putenv('CACHE_CLIENT=redis');
}

protected function tearDown()
protected function tearDown(): void
{
putenv('CACHE_CLIENT=');
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/RedisWithBinarySerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function test_should_return_redis_client()
$this->assertInstanceOf(\Redis::class, $this->cache->client());
}

protected function setUp()
protected function setUp(): void
{
putenv('CACHE_CLIENT=redis');

Expand Down
2 changes: 1 addition & 1 deletion Tests/RedisWithJsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function test_should_return_redis_client()
$this->assertInstanceOf(\Redis::class, $this->cache->client());
}

protected function setUp()
protected function setUp(): void
{
putenv('CACHE_CLIENT=redis');

Expand Down
2 changes: 1 addition & 1 deletion Tests/RedisWithOnlyJsonSerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function test_should_store_and_retrieve_the_same_cache_item($data)
}


protected function setUp()
protected function setUp(): void
{
$this->markTestSkipped('Redis JSON serializer skipped for now...');

Expand Down
2 changes: 1 addition & 1 deletion Tests/SimpleCacheTestCaseTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function simpleData()
];
}

protected function tearDown()
protected function tearDown(): void
{
putenv('CACHE_CLIENT=');

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"require": {
"php": "^7.3",
"php": "^7.2",
"koded/stdlib": "~4",
"psr/simple-cache": "~1",
"psr/log": "~1",
Expand All @@ -28,7 +28,7 @@
"suggest": {
"ext-redis": "For caching in Redis",
"ext-memcached": "For caching in Memcached",
"predis/predis": "If you want to use Redis without ext-redis extension",
"predis/predis": "For using Redis without ext-redis extension",
"ext-igbinary": "For Redis igbinary support",
"ext-msgpack": "For de/serializing the cache data"
},
Expand All @@ -45,10 +45,11 @@
},
"require-dev": {
"phpunit/phpunit": "~7",
"mikey179/vfsStream": "~1",
"mikey179/vfsstream": "~1",
"predis/predis": "dev-master",
"cache/integration-tests": "dev-master",
"codacy/coverage": "dev-master"
"codacy/coverage": "dev-master",
"symfony/phpunit-bridge": "^4.4@dev"
},
"extra": {
"branch-alias": {
Expand Down

0 comments on commit b006d5c

Please sign in to comment.