Skip to content

Commit aa9c34f

Browse files
author
Miquel Company Rodriguez
committed
App phpunit support
1 parent 8e13178 commit aa9c34f

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
vendor
2+
composer.lock

Test/RedisClient/ClientTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
/**
3+
* Created by PhpStorm.
4+
* User: miquel
5+
* Date: 17/03/14
6+
* Time: 11:38
7+
*/
8+
9+
namespace Solilokiam\HttpRedisCache\Test\RedisClient;
10+
11+
12+
use Solilokiam\HttpRedisCache\RedisClient\Client;
13+
14+
class ClientTest extends \PHPUnit_Framework_TestCase
15+
{
16+
protected $redisMock;
17+
18+
protected function setUp()
19+
{
20+
$this->redisMock = $this->getMock('Redis');
21+
}
22+
23+
public function testSimpleConnect()
24+
{
25+
$client = new Client(array('host' => 'localhost'));
26+
27+
$this->redisMock->expects($this->once())
28+
->method('connect')
29+
->with($this->equalTo('localhost'), $this->equalTo(null));
30+
}
31+
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"description": "An HttpCache extension with redis for Symfony 2",
44
"require": {
55
"php": ">=5.3.3",
6-
"symfony/framework-bundle": "2.3.*"
6+
"predis/predis": "0.8.*"
77
},
88
"require-dev": {
9-
"predis/predis": "0.8.*"
9+
"phpunit/phpunit": "3.7.14"
1010
},
1111
"license": "MIT",
1212
"authors": [

phpunit.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit colors="true" bootstrap="vendor/autoload.php">
3+
<testsuites>
4+
<testsuite name="Application Test Suite">
5+
<directory>./Test/</directory>
6+
</testsuite>
7+
</testsuites>
8+
</phpunit>

0 commit comments

Comments
 (0)