Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjo-blur committed Dec 3, 2013
2 parents 96511d5 + 11ff216 commit 647e91d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It is recommended to install Quahog through [composer](http://getcomposer.org).
## Usage

```php
$quahog = new \Quahog\Quahog();
$quahog = new \Quahog\Client();

// Scan a file
$result = $quahog->scanFile('/tmp/virusfile');
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "blurgroup/quahog",
"description": "A PHP client library for ClamAV clamd daemon",
"license": "MIT",
"minimum-stability": "dev",
"authors": [
{
"name": "Jonjo McKay",
Expand Down
7 changes: 3 additions & 4 deletions src/Quahog/Quahog.php → src/Quahog/Client.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?php
namespace Quahog;


use Quahog\Exception\ConnectionException;
use Socket\Raw\Factory;

/**
* Class Quahog
* Class Client
* @package Quahog
*/
class Quahog
class Client
{

/**
Expand All @@ -18,7 +17,7 @@ class Quahog
private $_socket;

/**
* Instantiate a Quahog\Quahog instance
* Instantiate a Quahog\Client instance
*
* @param string $location The hostname and port, or socket location to connect to clamd
* @throws Exception\ConnectionException
Expand Down
12 changes: 6 additions & 6 deletions tests/QuahogTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
use Quahog\Quahog;
use Quahog\Client;

include_once __DIR__ . '/../vendor/autoload.php';

Expand All @@ -10,7 +10,7 @@ class QuahogTest extends PHPUnit_Framework_TestCase
{

/**
* @var \Quahog\Quahog
* @var \Quahog\Client
*/
protected $quahog;

Expand All @@ -30,14 +30,14 @@ public static function tearDownAfterClass()

public function setUp()
{
$this->quahog = new Quahog('127.0.0.1:3311');
$this->quahog = new Client('127.0.0.1:3311');
}

public function testConstruct()
{
$this->setExpectedException('Quahog\Exception\ConnectionException');

new Quahog('not-a-real-clam-instance');
new Client('not-a-real-clam-instance');
}

public function testPingOK()
Expand All @@ -49,10 +49,10 @@ public function testPingOK()

public function testPingFail()
{
$quahogMock = $this->getMock('Quahog\Quahog', array('_receiveResponse'), array('127.0.0.1:3311'));
$quahogMock = $this->getMock('Quahog\Client', array('_receiveResponse'), array('127.0.0.1:3311'));
$quahogMock->expects($this->any())->method('_receiveResponse')->will($this->returnValue('NOPE'));

$reflection = new ReflectionClass('Quahog\Quahog');
$reflection = new ReflectionClass('Quahog\Client');

$method = $reflection->getMethod('_receiveResponse');
$method->setAccessible(true);
Expand Down

0 comments on commit 647e91d

Please sign in to comment.