Skip to content

Commit

Permalink
Adjusted Memcached/Redis tests to use env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
jamielsharief committed Jun 25, 2019
1 parent a17fc4c commit 120e7e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Expand Up @@ -3,6 +3,9 @@ php:
- 7.2
dist: xenial
env:
global:
- MEMCACHED_HOST=localhost MEMCACHED_PORT=11211
- REDDIS_HOST=localhost REDDIS_PORT=6379
matrix:
- DB_ENGINE=mysql DB_HOST=localhost DB_USERNAME=root
services:
Expand Down
8 changes: 8 additions & 0 deletions phpunit.xml.dist
Expand Up @@ -42,6 +42,14 @@
<env name="GMAIL_USERNAME" value="james@example.com"/>
<env name="GMAIl_PASSWORD" value="secret"/>
-->
<!-- # Redis Testing
<env name="REDIS_HOST" value="localhost"/>
<env name="REDIS_PORT" value="6379"/>
-->
<!-- # Memcached Testing
<env name="MEMCACHED_HOST" value="localhost"/>
<env name="MEMCACHED_PORT" value="11211"/>
-->
<!-- # Storage (SFTP) Testing
<env name="SFTP_HOST" value="192.168.0.7"/>
<env name="SFTP_USERNAME" value="username"/>
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase/Engine/Cache/MemcachedEngineTest.php
Expand Up @@ -45,7 +45,8 @@ public function setUp()
public function engine()
{
return new MockMemcachedEngine([
'host' => 'memcached',
'host' => env('MEMCACHED_HOST'),
'port' => env('MEMCACHED_PORT'),
'duration' => 3600,
'prefix' => 'origin_'
]);
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase/Engine/Cache/RedisEngineTest.php
Expand Up @@ -46,7 +46,8 @@ public function setUp()
public function engine()
{
return new MockRedisEngine([
'host' => 'redis',
'host' => env('REDIS_HOST'),
'port' => env('REDIS_PORT'),
'duration' => 3600,
'prefix' => 'origin_'
]);
Expand Down

0 comments on commit 120e7e7

Please sign in to comment.