mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Make tests not fail when extensions are installed
If the extensions are installed but memcached/redis are not running errors should not be emitted.
This commit is contained in:
parent
7a5907057a
commit
8f3df8b13e
2 changed files with 13 additions and 0 deletions
|
@ -64,6 +64,12 @@ class MemcachedEngineTest extends CakeTestCase {
|
|||
parent::setUp();
|
||||
$this->skipIf(!class_exists('Memcached'), 'Memcached is not installed or configured properly.');
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
$socket = @fsockopen('127.0.0.1', 11211, $errno, $errstr, 1);
|
||||
// @codingStandardsIgnoreEnd
|
||||
$this->skipIf(!$socket, 'Memcached is not running.');
|
||||
fclose($socket);
|
||||
|
||||
Cache::config('memcached', array(
|
||||
'engine' => 'Memcached',
|
||||
'prefix' => 'cake_',
|
||||
|
|
|
@ -37,6 +37,13 @@ class RedisEngineTest extends CakeTestCase {
|
|||
|
||||
$this->_cacheDisable = Configure::read('Cache.disable');
|
||||
Configure::write('Cache.disable', false);
|
||||
|
||||
// @codingStandardsIgnoreStart
|
||||
$socket = @fsockopen('127.0.0.1', 6379, $errno, $errstr, 1);
|
||||
// @codingStandardsIgnoreEnd
|
||||
$this->skipIf(!$socket, 'Redis is not running.');
|
||||
fclose($socket);
|
||||
|
||||
Cache::config('redis', array(
|
||||
'engine' => 'Redis',
|
||||
'prefix' => 'cake_',
|
||||
|
|
Loading…
Add table
Reference in a new issue